+1 vote

unfortunately I have another issue when using mail.dll:
When using SendMessage() with authorization and using a From address not recognized by the SMTP-Server, I receive no information about it. In this case I would expect to get an exception like "5.7.60 SMTP; Client does not have permissions to send as this sender" but this is not the case. So the user isn't aware that the mail is never reaching its destination.
Am I doing something wrong? What can I do in this case?

Thank you for your help ;)

by (560 points)

1 Answer

+1 vote
Best answer

You should probably check the return value of Smtp.SendMessage:

ISendMessageResult result = smtp.SendMessage(email);
if (result.Status == SendMessageStatus.Success)
     // Message was sent.

You can examine ApprovedRecipients, RejectedRecipients and FromRejected on failure.

by (298k points)
selected by