SMTP send mail asychron

Oct 21, 2012 at 9:12 AM

Hi,

I'm just start looking for your dll, i'would use imap in an .net app

With mail .net component i sent all mails in asychrone mode

How can i do that with your smtpclient ?

 

Thank

Coordinator
Oct 21, 2012 at 11:38 PM

Hi.
SmtpClient of Current version(2012/10/21) does not have async mode.
You can send mail asynchronously by using Task object.

---------------------------------------------------------------------------------------------------------------
SmtpClient cl = new SmtpClient();
//Set property of cl
SmtpMessage mg = new SmtpMessage();
//Set property of mg
Task<SendMailResult> t = new Task<SendMailResult>(() => cl.SendMail(mg));
t.Start();
var rs = t.Result;
---------------------------------------------------------------------------------------------------------------

I'll add async version to SmtpClient in the future.

regards.

Oct 22, 2012 at 8:49 AM

Thank for your reply

Of course i can do that

i have another question, i'll post it in an another topic