public event SmtpMessageNotSentEventHandler MessageNotSent
Public Event MessageNotSent As SmtpMessageNotSentEventHandler
This event is a counterpart of MessageSent event.
event occurs only when there was an attempt to send a message and this attempt failed. Such attempt could be complex, such as sending to a primary and a backup mail servers. If, however, MailBee was unable to send the e-mail to the primary server but managed to send it to the backup one (or send it using alternative method, such as direct send), will not be raised.
may occur only for e-mail messages which have already been created. If the error occurred before the message was even built, this event will not occur. The same applies to the events which are raised when a message is about to be sent (or submitted to the pickup folder).
For instance, if SendJobs or SendMailMerge(String, EmailAddressCollection, DataTable) method is running and mail merge of a data row with the mail template failed for some reason, SendingMessage and events will not occur.
If you have mail merge functionality in your application and need to subscribe to an event which occurs before performing mail merge of a data row with the template, use MergingMessage event.