Creates an e-mail message from a text file to send by means of SMTP (Simple Mail Transfer Protocol).
- recipients
- A comma-separated list of message recipients.
- replacements
- An IDictionary containing a list of strings and their replacement strings.
- owner
- The System.Web.UI.Control that owns this System.Web.UI.WebControls.MailDefinition.
The e-mail message 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 using the System.Net.Mail.SmtpClient.Send(string, string, string, string) method.
The System.Web.Mail.MailMessage.BodyFormat property must be set to indicate whether the mail message should be formatted as plain text (System.Web.Mail.MailFormat.Text) or HTML (System.Web.Mail.MailFormat.Html).
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 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.