Occurs when the message is about to be sent.
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. |
The developer can typically use this event for the following purposes:
mailer.DeliveryNotification.TrackingID value (where mailer is Smtp instance) prior to calling SendMailMerge or SendJobs. However, other DSN values (NotifyCondition and ReturnPortion) can be set for every e-mail separately only in SendingMessage event handler. This is because other DSN values are not strings and search-and-replace is not possible for them. However, most applications use the same NotifyCondition and ReturnPortion values for all e-mail messages within a mail merge job.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).
The example is available at SendMailMerge topic.
Smtp Class | MailBee.SmtpMail Namespace