MailBee.NET Objects 4.0

Smtp.SendingMessage Event

Occurs when the message is about to be sent.

public event SmtpSendingMessageEventHandler SendingMessage;

Event Data

The event handler receives an argument of type SmtpSendingMessageEventArgs containing data related to this event. The following SmtpSendingMessageEventArgs properties provide information specific to this event.

Property Description
ActualRecipients Gets or sets the list of recipients the message is addressed to.
ActualSenderEmail Gets or sets the e-mail address of the sender of the mail message.
DeliveryNotification Gets the delivery status notification settings of the mail message to be sent.
MailMessage Gets the mail message which is about to be sent.
MergeRowIndex Gets the index of the data row used for mail merge of this message.
MergeTable Gets the reference to the data table used for mail merge of this message.
SendIt Gets or sets whether this message will be sent.
State Gets a reference to the object which was supplied by the developer in state parameter of asynchronous methods of the mailer components.
Tag Gets the tag assigned by the developer to SendMailJob of processing the given message.

Remarks

The developer can typically use this event for the following purposes:

Note   If you changed the message sender or recipients via modification of the e-mail message itself (MailMessage property), you should also update ActualSenderEmail or ActualRecipients as well (for instance, set them to a null reference (Nothing in Visual Basic) to tell MailBee to grab these values from MailMessage property. Alternatively, if you only changed ActualSenderEmail or ActualRecipients, the corresponding message headers won't be changed (the message will be sent from or to addresses different from those specified in the message headers).

Example

The example is available at SendMailMerge topic.

See Also

Smtp Class | MailBee.SmtpMail Namespace