Trapping exceptions when sending email

Hi, i was able to sent an email message with Aspose.Network. Now i'm heading the task to refine the exceptions which can occur:-

  1. connection timeout
  2. mail host unknown
  3. recipient unknown
  4. etc. etc

I looked into the manual (api reference) but cannot find an example which clarifies this subject ... (except that there is a mail exception class ...))

pls advice about this subject ...

thks Aat Jan

Hello AJ,

Thank you for your post!

Indeed. Our developers will provide documentation dedicated to exception handling in sending emails. Thank you for the information you posted, really appriciate that.

Best regards.

Here is quick reference for your question

  1. For connection timeout, mail host unknow,

catch SmtpException.

SmtpClient.Connect, SmtpClient.Login will throw SmtpException if errors.

2. For recipient unknown,

catch SmtpFailedRecipientException, SmtpFailedRecipientsException

I will provide more detail in a demo for you.

Thanks