GSF.Net.Smtp.Mail.Send C# (CSharp) Метод

Send() публичный статический Метод

Sends a secure Mail message.
public static Send ( string from, string toRecipients, string subject, string body, bool isBodyHtml, string smtpServer, string username, string password, bool enableSSL ) : void
from string The e-mail address of the message sender.
toRecipients string A comma-separated or semicolon-separated e-mail address list of the message recipients.
subject string The subject of the message.
body string The body of the message.
isBodyHtml bool true if the message body is to be formated as HTML; otherwise false.
smtpServer string The name or IP address of the SMTP server to be used for sending the message.
username string The username of the account used to authenticate to the SMTP server.
password string The password of the account used to authenticate to the SMTP server.
enableSSL bool The flag that determines whether to use SSL when communicating with the SMTP server.
Результат void
        public static void Send(string from, string toRecipients, string subject, string body, bool isBodyHtml, string smtpServer, string username, string password, bool enableSSL)
        {
            Send(from, toRecipients, subject, body, isBodyHtml, smtpServer, username, password.ToSecureString(), enableSSL);
        }

Same methods

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 attachments, string smtpServer ) : void
Mail::Send ( string from, string toRecipients, string subject, string body, bool isBodyHtml, string smtpServer, string username, SecureString password ) : void
Mail::Send ( string from, string toRecipients, string subject, string body, bool isBodyHtml, string smtpServer, string username, SecureString password, bool enableSSL ) : void
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 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

Usage Example

Пример #1
0
 /// <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();
     }
 }
All Usage Examples Of GSF.Net.Smtp.Mail::Send