SendMailJob Class
Represents a task to send (or submit to the pickup folder) a single e-mail message or a series of e-mail messages created as a mail merge of a data table and an e-mail template.
Inheritance Hierarchy
SystemObject
  MailBee.SmtpMailSendMailJob

Namespace: MailBee.SmtpMail
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax
public class SendMailJob

The SendMailJob type exposes the following members.

Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodCode exampleGetIndicesAsString
Returns the string containing comma-separated list of data table row indices yet to be processed as mail merge.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties
  NameDescription
Public propertyDsnSettings
Gets a reference to the delivery status notification settings for the mail message (or their patterns for mail merge jobs).
Public propertyErrorReason
Gets the reason of the error which prevented the mail message from being sent or submitted to the pickup folder.
Public propertyIsMessageSent
Gets if the message was successfully sent or submitted to the pickup folder.
Public propertyMergeDataReader
Gets the data reader for the mail merge.
Public propertyMergeDataReaderColumnNames
Gets the array of all fields' names of the current row of the data reader.
Public propertyMergeDataReaderRowValues
Gets the array of all fields' values of the current row of the data reader.
Public propertyMergedDsnSettings
Gets a reference to the delivery status notification settings produced by mail merge process.
Public propertyMergedMessage
Gets a reference to the mail message produced as a result of mail merge of the template with a data row.
Public propertyMergedRecipients
Gets the list of the actual recipients produced by mail merge process.
Public propertyMergedSenderEmail
Gets the actual sender e-mail address string produced by mail merge process.
Public propertyMergeRowIndex
Gets the index of the data row used for mail merge of this message.
Public propertyMergeTable
Gets the data table for the mail merge.
Public propertyMessage
Gets a reference to the mail message object to be sent or merged.
Public propertyMessageFilename
Gets the path of the e-mail file which contain the message to be sent.
Public propertyPreferXSenderXReceiver
Gets if "X-Sender" and "X-Receiver" message headers have priority over any other method of specifying sender and recipients for this message.
Public propertyRecipients
Gets the list of the actual recipients of the mail message (or its pattern for mail merge jobs).
Public propertySenderEmail
Gets the actual sender e-mail address string (or its pattern for mail merge jobs).
Public propertyTag
Gets the tag assigned by the developer to this job.
Top
Remarks

Send-mail job is a task for MailBee to create and/or send individual mail message or a series of messages based on a common template (mail merge).

Note Note
Mail merge over database is not supported in .NET Core and UWP apps yet.

Jobs can be created using AddJob(String, String, EmailAddressCollection) method of Smtp class (there are several overloads for mail merge and single message jobs).

Once one or more jobs have been added to the JobsPending queue, the developer can request to start processing of these jobs. This processing usually involves sending out e-mail messages contained in jobs or submitting these e-mail messages to a pickup folder for direct delivery to the SMTP server or MailBee.NET Queue if it's installed on the same machine where MailBee-powered application is running.

To start processing jobs, use SendJobs, BeginSendJobs(AsyncCallback, Object), or SubmitJobsToPickupFolder(String, Boolean) methods.

When the job assumes sending of a single e-mail message, no extra jobs are created. However, when the job is a mail merge job (and thus actually assumes creating and sending multiple messages), MailBee processes such job via creating a series of individual mail merge jobs (each of them assumes sending a single e-mail message). For instance, if a mail merge job for processing 100 data rows has been put into processing, MailBee will finally end up with 100 items total in JobsSuccessful and JobsFailed collections. This default behavior, however, can be changed with AddJob(String, String, EmailAddressCollection, DataTable, Object, Boolean, Boolean) overload.

Note Note
The easiest way to perform mail merge is using SendMailMerge(String, EmailAddressCollection, DataTable) method. It can be used to put a "mail merge over database" job into the queue and immediately process it, doing mail merge for each row in the data table with a e-mail template and then sending out resulting e-mail messages.
See Also