jstedfast / MailKit

A cross-platform .NET library for IMAP, POP3, and SMTP.

Home Page:http://www.mimekit.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SMTP Client Send Result

r-work opened this issue · comments

commented

How do you determine if sending the email was successful?

The Send/SendAsync methods return a string, which at the moment for me it returns something like:
XXXXXXXXXX mail accepted for delivery.

And I'm pretty sure I've had results like OK in the past.

Is there way to simply know if the message was sent (i.e true/false) rather than trying to see if result contains 'OK', 'Accepted' etc..

If the method throws an exception, then it failed. If it doesn't throw an exception, then it succeeded.

commented

Thanks for the quick reply.
That should probably be mentioned in the method documentation.