Creates an e-mail message with replacements from a text file to send by means of SMTP (Simple Mail Transfer Protocol).
- recipients
- The comma-separated list of recipients.
- replacements
- An IDictionary containing a list of strings and their replacement strings.
- body
- The text of the e-mail message.
- owner
- The System.Web.UI.Control that owns this System.Web.UI.WebControls.MailDefinition.
The e-mail message with replacements from a text file.
The MailDefinition.CreateMailMessage(string, IDictionary, System.Web.UI.Control) method creates a new System.Net.Mail.MailMessage object that can be sent with the System.Net.Mail.SmtpClient.Send(string, string, string, string) method.
The recipients parameter contains a comma-separated list of recipients of the e-mail message. If the recipients parameter contains an improperly formatted Internet e-mail address, the System.Net.Mail.SmtpClient.Send(string, string, string, string) method throws an System.Web.HttpException exception and the e-mail message is not sent.
The replacements parameter is an IDictionary instance that contains a list of strings to substitute. Strings are replaced in the order in which they were added to the IDictionary collection, and they can overwrite earlier replacements.
The body parameter contains the text of the e-mail message.
The owner parameter indicates which control is the parent of the System.Web.UI.WebControls.MailDefinition control. It determines which directory to search for the text file specified in the MailDefinition.BodyFileName property.