using System.Net.Mail;
public void SendMailNow(string from, string to, string title, string content) |
{ |
SmtpClient smtp = new SmtpClient(Host); |
smtp.DeliveryMethod = SmtpDeliveryMethod.Network; |
MailMessage msg = new MailMessage(from, to, title, content); |
msg.BodyEncoding = Encoding.GetEncoding(950); |
msg.SubjectEncoding = Encoding.GetEncoding(950); //950 - traditional chinese |
smtp.Send(msg); |
} |
I use the above code to send email. How can I get the failed email addresses?
Try this code. You will have all failed addresses in the FailedAddresses List: