Occurs when the message is about to be sent.
Namespace: MailBee.SmtpMailAssembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax Remarks
The developer can typically use this event for the following purposes:
- Control whether particular messages should be skipped (not sent).
This can be useful when performing mail merge tasks. To make the message be skipped,
set SendIt to false.
- Fine-tune messages before they get sent.
This is also useful in mail merge tasks if the developer wants to perform some actions
on the messages which had already been merged. You can change properties of the mail message itself
(returned by MailMessage property), change
ActualSenderEmail or
ActualRecipients.
- Change Delivery Status Notification (DSN) settings of the message.
It's easier to specify a template for DSN Tracking-ID via setting mailer.DeliveryNotification.TrackingID value
(where mailer is Smtp instance) prior to calling SendMailMerge(String, EmailAddressCollection, DataTable) 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).
|
Examples See Also