SmtpMessageNotSent Event
Occurs when the message was not sent due to an error.

Namespace: MailBee.SmtpMail
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 11.2.0 build 590 for .NET 4.5
Syntax
public event SmtpMessageNotSentEventHandler MessageNotSent

Value

Type: MailBee.SmtpMailSmtpMessageNotSentEventHandler
Remarks

This event is a counterpart of MessageSent event.

MessageNotSent 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), MessageNotSent will not be raised.

MessageNotSent 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 MessageNotSent 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.

Examples
See Also