I am looking for C# equivalent of mail.smtp.sendpartial property
http://javamail.kenai.com/nonav/javadocs/com/sun/mail/smtp/package-summary.html
If set to true, and a message has some valid and some invalid addresses, send the message anyway, reporting the partial failure with a SendFailedException. If set to false (the default), the message is not sent to any of the recipients if there is an invalid(mailbox doesnt exist on the server) recipient address.
public static void sendMails(string ptxtSubject, string ptxtBody)
{
string txtTo = "valid1@aaa.com,valid2@aaa.com,invalid1@aaa.com";
string txtFrom = "valid@aaa.com";
string txtSubject = ptxtSubject;
string txtBody = ptxtBody;
MailMessage mail = new MailMessage();
mail.To = txtTo;
mail.From = txtFrom;
mail.Subject = txtSubject;
mail.Body = txtBody;
try
{
SmtpMail.SmtpServer ="smtp.aaa.com";
SmtpMail.Send(mail);
}
catch (Exception ex)
{
//log the exception
throw;
}
}
This is the C# code I am using, but it fails to send email even if only one of the email addresses is invalid.
Google did not help,Any pointers are appreciated.