Is there way to see if System.Net.Mail worked

Posted by eski on Stack Overflow See other posts from Stack Overflow or by eski
Published on 2010-05-04T10:36:08Z Indexed on 2010/05/04 10:38 UTC
Read the original article Hit count: 319

Filed under:
|
|

I'm using System.Net.Mail to send email, like so :

MailMessage message = new MailMessage();

message.From = new MailAddress("[email protected]");
message.To.Add(new MailAddress("[email protected]"));


message.Subject = "Hello";
message.Body = "This is a nice body..";

SmtpClient client = new SmtpClient();
client.Send(message);

How can i know if the E-mail was sent, can i put in a if sentence to check it out ? What would it look like then ?

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET