Here is my problem. I am sending an email to few contacts and I am catching the error if there is a unvalid email addresse.
Basicly, it is working, but if there is more than 1 invalid email, I am not receiving notification from others bad email addresse.
data = XMLProcessing.LoadAll();
foreach (XMLData.StructReceiver user in data.Receiver)
{
AddReceiver(user.Mail);
}
SetSubject(data.Body.Subject);
SetMessage(data.Body.Content);
SetSender(data.SenderReply.Sender);
SetReply(data.SenderReply.Replyer);
try
{
SMTP.Send(Message);
}
catch (SmtpFailedRecipientException e)
{
if (e.FailedRecipient.ToString() != data.SenderReply.Replyer)
{
Failed.Add(e.FailedRecipient.ToString());
}
}
finally
{
SMTP.Dispose();
}
I am receiving notification by adding the contact into a list and then sending this list to my personnal email addresse, but the catch only happen one time, even if there is more than 1 bad addresse.