C# Class ScrewTurn.Wiki.EmailTools

Implements email-related tools.
显示文件 Open project: mono/ScrewTurnWiki Class Usage Examples

Public Methods

Method Description
AsyncSendEmail ( string recipient, string sender, string subject, string body, bool html ) : void

Sends an email.

AsyncSendMassEmail ( string recipients, string sender, string subject, string body, bool html ) : void

Asynchronously sends a mass email, using BCC.

GetRecipients ( UserInfo users ) : string[]

Gets the email addresses of a set of users.

NotifyError ( Exception ex, string url ) : void

Notifies an error to the email addresses set in the configuration, swallowing all exceptions.

Private Methods

Method Description
GenerateSmtpClient ( ) : SmtpClient

Generates a new SMTP client with the proper settings.

TrySendMessage ( MailMessage message ) : void

Tries to send a message, swallowing all exceptions.

Method Details

AsyncSendEmail() public static method

Sends an email.
public static AsyncSendEmail ( string recipient, string sender, string subject, string body, bool html ) : void
recipient string The recipient.
sender string The sender.
subject string The subject.
body string The message body.
html bool true if the body is HTML.
return void

AsyncSendMassEmail() public static method

Asynchronously sends a mass email, using BCC.
public static AsyncSendMassEmail ( string recipients, string sender, string subject, string body, bool html ) : void
recipients string The recipents.
sender string The sender.
subject string The subject.
body string The body.
html bool true if the body is HTML.
return void

GetRecipients() public static method

Gets the email addresses of a set of users.
public static GetRecipients ( UserInfo users ) : string[]
users UserInfo The users.
return string[]

NotifyError() public static method

Notifies an error to the email addresses set in the configuration, swallowing all exceptions.
public static NotifyError ( Exception ex, string url ) : void
ex System.Exception The exception to notify.
url string The URL that caused the error, if any.
return void