I'm trying to send an email async so it doesn't slow down my front end (Asp.Net MVC).
SmtpClient smtp = new SmtpClient(_mailServer, 25);
smtp.UseDefaultCredentials = true;
MailMessage message = new MailMessage();
// ...etc
smtp.SendA(message); // this works fine
smtp.SendAsync(message, null); // if i change it to this, it doesn't work (mail never appears)
I don't really undestand what the 2nd param to SendAsync
is for.
MSDN says its an object to pass to the method that is invoked when the operation completes
well, wtf? what method? So I've just tried passing null as I don't really understand what this is for, but obviously something is wrong.