MailBee.NET Objects 4.0

Smtp.MergingMessage Event

Occurs when the component is about to merge the e-mail template with a single data table row.

public event SmtpMergingMessageEventHandler MergingMessage;

Event Data

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

Property Description
MergeIt Gets or sets whether the current data row will be merged with the mail template.
MergeRowIndex Gets the index of the data table row which is about to be merged with the mail message template.
MergeTable Gets the data table whose row is about to be merged with the mail message template.
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.
TemplateDeliveryNotification Gets the delivery status notification template which is about to be merged with the data from a database table row.
TemplateMessage Gets the mail message template which is about to be merged with the data from a database table row.
TemplateRecipients Gets the actual recipients template which is about to be merged with the data from a database table row.
TemplateSenderEmail Gets the actual sender's e-mail address template which is about to be merged with the data from a database table row.

Remarks

This event precedes any other Smtp events which occur for every e-mail message being sent. MergingMessage, however, it not raised for e-mails which were supplied by the application rather than generated during mail merge.

For mail merge jobs, this event allows the developer to control whether to proceed mail merge of a particular data row with the template and send the resulting e-mail or skip this data row and continue.

If you need to perform some post-processing of mail messages which have already been merged (i.e. an event which occurs AFTER mail merge of a data row with the template), use SendingMessage event (if you're sending e-mails out) or SubmittingMessageToPickupFolder event (if you're submitting them to the pickup folder).

Example

The example is available at SubmitJobsToPickupFolder topic.

See Also

Smtp Class | MailBee.SmtpMail Namespace | SendingMessage | SubmittingMessageToPickupFolder