public static Send ( string from, string toRecipients, string subject, string body, bool isBodyHtml, string attachments, string smtpServer ) : void | ||
from | string | The e-mail address of the |
toRecipients | string | A comma-separated or semicolon-separated e-mail address list of the |
subject | string | The subject of the |
body | string | The body of the |
isBodyHtml | bool | true if the |
attachments | string | A comma-separated or semicolon-separated list of file names to be attached to the |
smtpServer | string | The name or IP address of the SMTP server to be used for sending the |
Результат | void |
public static void Send(string from, string toRecipients, string subject, string body, bool isBodyHtml, string attachments, string smtpServer)
{
Send(from, toRecipients, null, null, subject, body, isBodyHtml, attachments, smtpServer);
}
Mail::Send ( ) : void | |
Mail::Send ( string from, string toRecipients, string subject, string body, bool isBodyHtml, string smtpServer ) : void | |
Mail::Send ( string from, string toRecipients, string subject, string body, bool isBodyHtml, string smtpServer, string username, |
|
Mail::Send ( string from, string toRecipients, string subject, string body, bool isBodyHtml, string smtpServer, string username, |
|
Mail::Send ( string from, string toRecipients, string subject, string body, bool isBodyHtml, string smtpServer, string username, string password ) : void | |
Mail::Send ( string from, string toRecipients, string subject, string body, bool isBodyHtml, string smtpServer, string username, string password, bool enableSSL ) : void | |
Mail::Send ( string from, string toRecipients, string ccRecipients, string bccRecipients, string subject, string body, bool isBodyHtml, string smtpServer ) : void | |
Mail::Send ( string from, string toRecipients, string ccRecipients, string bccRecipients, string subject, string body, bool isBodyHtml, string attachments, string smtpServer ) : void |
/// <summary> /// Sends a secure <see cref="Mail"/> message. /// </summary> /// <param name="from">The e-mail address of the <see cref="Mail"/> message sender.</param> /// <param name="toRecipients">A comma-separated or semicolon-separated e-mail address list of the <see cref="Mail"/> message recipients.</param> /// <param name="subject">The subject of the <see cref="Mail"/> message.</param> /// <param name="body">The body of the <see cref="Mail"/> message.</param> /// <param name="isBodyHtml">true if the <see cref="Mail"/> message body is to be formated as HTML; otherwise false.</param> /// <param name="smtpServer">The name or IP address of the SMTP server to be used for sending the <see cref="Mail"/> message.</param> /// <param name="username">The username of the account used to authenticate to the SMTP server.</param> /// <param name="password">The password of the account used to authenticate to the SMTP server.</param> /// <param name="enableSSL">The flag that determines whether to use SSL when communicating with the SMTP server.</param> public static void Send(string from, string toRecipients, string subject, string body, bool isBodyHtml, string smtpServer, string username, SecureString password, bool enableSSL) { using (Mail email = new Mail(from, toRecipients, smtpServer)) { email.Subject = subject; email.Body = body; email.IsBodyHtml = isBodyHtml; email.Username = username; email.SecurePassword = password; email.EnableSSL = enableSSL; email.Send(); } }