Skip to content

DotNet API for creating & managing temporary emails based on 1secMail.

License

Notifications You must be signed in to change notification settings

sh1ngekyo/1secMail-DotNet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

1secMail-DotNet

DotNet API for creating and managing temporary emails based on 1secMail.

Using:

using OneSecEmailDotNet.Core;

Create instance of EmailService:

using (var es = new EmailService(/*optional: proxy*/))
{
//do your work
}

Create new email address:

using (var es = new EmailService(/*optional: proxy*/))
{
	//Create 1 mailbox
	var mailbox = await es.CreateAsync();
	//Create 5 mailboxes
	var mailboxes = await es.CreateAsync(5);
}

Get message by ID:

await es.GetMessageByIdAsync(mailbox, 123);

Download attachments:

await es.DownloadAttachmentAsync(email, message.Id, attachment.FileName);

Example update:

while (!await es.ContainsNewMessagesAsync(mailbox))
{
	//check every 20 sec
	await Task.Delay(1000 * 20);
}
//email auto update 
await es.UpdateEmailAsync(mailbox);

Or do it manualy with:

GetNewMessagesId(...);
GetMessageByIdAsync(...);

Dispose after done:

es.Dispose();

Releases

No releases published

Packages

No packages published

Languages