0 votes

I have tried to get an SendMessageStatus.Failure or an SendMessageStatus.PartialSuccess result when mailing but haven't succeeded. The result has always returned succeeded even when using addresses that don't exist.

What kind of email-message would return failure.Has it something to do with the addresses (from,to cc,bcc) or is there other mechanisms at work here? Body,header,subject etc.

I have tried not properly formatted email addresses but when trying to add these email addresses first using Mailbox, it seems that it is the Mailbox class that throws an exception.

related to an answer for: Get SmtpResponse
by

1 Answer

0 votes

It is the SMTP server that returns an error or not.

Some SMTP servers accept everything and simply generate bounce emails at some later point. Usually the server can only check existence of its local addresses only

If you believe the server is acting incorrectly, you need to contact SMTP server administrator.

You can turn on logging to see exact client-server communication:
https://www.limilabs.com/blog/logging-in-mail-dll

I have tried not properly formatted email addresses but when trying to
add these email addresses first using Mailbox, it seems that it is the
Mailbox class that throws an exception.

This is expected and correct behavior.
You can use MailBox.CreateWithoutValidation method to skip validation rules.

by (297k points)
...