C# Класс GSF.Net.Smtp.Mail

A wrapper class to the MailMessage class that simplifies sending mail messages.
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Dispose ( ) : void

Releases all the resources used by the Mail object.

Mail ( ) : System

Initializes a new instance of the Mail class.

Mail ( string from ) : System

Initializes a new instance of the Mail class.

Mail ( string from, string toRecipients ) : System

Initializes a new instance of the Mail class.

Mail ( string from, string toRecipients, string smtpServer ) : System

Initializes a new instance of the Mail class.

Send ( ) : void

Send the Mail message with Attachments to the ToRecipients, CcRecipients and BccRecipients using the specified SmtpServer.

Send ( string from, string toRecipients, string subject, string body, bool isBodyHtml, string smtpServer ) : void

Sends a Mail message.

Send ( string from, string toRecipients, string subject, string body, bool isBodyHtml, string attachments, string smtpServer ) : void

Sends a Mail message.

Send ( string from, string toRecipients, string subject, string body, bool isBodyHtml, string smtpServer, string username, SecureString password ) : void

Sends a secure Mail message.

Send ( string from, string toRecipients, string subject, string body, bool isBodyHtml, string smtpServer, string username, SecureString password, bool enableSSL ) : void

Sends a secure Mail message.

Send ( string from, string toRecipients, string subject, string body, bool isBodyHtml, string smtpServer, string username, string password ) : void

Sends a secure Mail message.

Send ( string from, string toRecipients, string subject, string body, bool isBodyHtml, string smtpServer, string username, string password, bool enableSSL ) : void

Sends a secure Mail message.

Send ( string from, string toRecipients, string ccRecipients, string bccRecipients, string subject, string body, bool isBodyHtml, string smtpServer ) : void

Sends a Mail message.

Send ( string from, string toRecipients, string ccRecipients, string bccRecipients, string subject, string body, bool isBodyHtml, string attachments, string smtpServer ) : void

Sends a Mail message.

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Releases the unmanaged resources used by the Mail object and optionally releases the managed resources.

Приватные методы

Метод Описание
ApplySecuritySettings ( ) : void

Описание методов

Dispose() публичный метод

Releases all the resources used by the Mail object.
public Dispose ( ) : void
Результат void

Dispose() защищенный метод

Releases the unmanaged resources used by the Mail object and optionally releases the managed resources.
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; false to release only unmanaged resources.
Результат void

Mail() публичный метод

Initializes a new instance of the Mail class.
public Mail ( ) : System
Результат System

Mail() публичный метод

Initializes a new instance of the Mail class.
public Mail ( string from ) : System
from string The e-mail address of the message sender.
Результат System

Mail() публичный метод

Initializes a new instance of the Mail class.
public Mail ( string from, string toRecipients ) : System
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.
Результат System

Mail() публичный метод

Initializes a new instance of the Mail class.
public Mail ( string from, string toRecipients, string smtpServer ) : System
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.
smtpServer string The name or IP address of the SMTP server to be used for sending the message.
Результат System

Send() публичный метод

Send the Mail message with Attachments to the ToRecipients, CcRecipients and BccRecipients using the specified SmtpServer.
public Send ( ) : void
Результат void

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

Sends a Mail message.
public static Send ( string from, string toRecipients, string subject, string body, bool isBodyHtml, string smtpServer ) : 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.
Результат void

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

Sends a Mail message.
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 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.
attachments string A comma-separated or semicolon-separated list of file names to be attached to the message.
smtpServer string The name or IP address of the SMTP server to be used for sending the message.
Результат void

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

Sends a secure Mail message.
public static Send ( string from, string toRecipients, string subject, string body, bool isBodyHtml, string smtpServer, string username, SecureString password ) : 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 System.Security.SecureString The password of the account used to authenticate to the SMTP server.
Результат void

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

Sends a secure Mail message.
public static Send ( string from, string toRecipients, string subject, string body, bool isBodyHtml, string smtpServer, string username, SecureString 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 System.Security.SecureString 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

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 ) : 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.
Результат void

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

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

Sends a Mail message.
public static Send ( string from, string toRecipients, string ccRecipients, string bccRecipients, string subject, string body, bool isBodyHtml, string smtpServer ) : 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.
ccRecipients string A comma-separated or semicolon-separated e-mail address list of the message carbon copy (CC) recipients.
bccRecipients string A comma-separated or semicolon-separated e-mail address list of the message blank carbon copy (BCC) 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.
Результат void

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

Sends a Mail message.
public static Send ( string from, string toRecipients, string ccRecipients, string bccRecipients, string subject, string body, bool isBodyHtml, string attachments, string smtpServer ) : 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.
ccRecipients string A comma-separated or semicolon-separated e-mail address list of the message carbon copy (CC) recipients.
bccRecipients string A comma-separated or semicolon-separated e-mail address list of the message blank carbon copy (BCC) 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.
attachments string A comma-separated or semicolon-separated list of file names to be attached to the message.
smtpServer string The name or IP address of the SMTP server to be used for sending the message.
Результат void