C# Class Rolcore.Net.Mail.EmailUtils

Utilities that simplify email related tasks.
Datei anzeigen Open project: Rollins/Rolcore

Public Methods

Method Description
CreateMessage ( string to, string cc, string bcc, string from, string subject, string body, bool isBodyHtml ) : MailMessage

Creates and configures a MailMessage.

LenientIsEmailAddress ( string email ) : bool

Validates an email address according to lenient rules.

SendEmail ( MailMessage message, string smtpServer = null ) : void

Sends the given message via email using the given SMTP server.

StrictIsEmailAddress ( string email ) : bool

Validates an email address according to strict rules.

Private Methods

Method Description
CreateLenientEmailAddressMatcher ( ) : Regex
CreateStrictEmailAddressMatcher ( ) : Regex

Method Details

CreateMessage() public static method

Creates and configures a MailMessage.
public static CreateMessage ( string to, string cc, string bcc, string from, string subject, string body, bool isBodyHtml ) : MailMessage
to string The value for
cc string
bcc string The value for
from string The value for
subject string The value for
body string The value for
isBodyHtml bool
return System.Net.Mail.MailMessage

LenientIsEmailAddress() public static method

Validates an email address according to lenient rules.
public static LenientIsEmailAddress ( string email ) : bool
email string The email address to validate
return bool

SendEmail() public static method

Sends the given message via email using the given SMTP server.
public static SendEmail ( MailMessage message, string smtpServer = null ) : void
message System.Net.Mail.MailMessage The message to send.
smtpServer string The SMTP server to send the message through.
return void

StrictIsEmailAddress() public static method

Validates an email address according to strict rules.
public static StrictIsEmailAddress ( string email ) : bool
email string The email address to validate.
return bool