Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Sealed class: RT.Util.RTSmtpClient

Summary

Provides methods to send e-mails via an SMTP server.

Constructors

RTSmtpClient(string host, int port, string username = null, string password = null, SmtpEncryption encryption = SmtpEncryption.None, LoggerBase log = null, int timeout = 10000)
Creates a connection to the SMTP server and authenticates the specified user.
RTSmtpClient(RTSmtpSettings settings, LoggerBase log = null)

Instance methods

void
  • Implements: IDisposable.Dispose()
Closes the SMTP connection and frees all associated resources.
void
SendEmail(MailAddress from, IEnumerable<MailAddress> to, string subject, string bodyPlain, string bodyHtml)
Sends an e-mail.
void
SendEmail(MailAddress from, IEnumerable<MailAddress> to, IEnumerable<string> headers, string bodyPlain, string bodyHtml)
Sends an email with fully custom headers.

Static methods

string
EncodeHeader(string name, string value)
Encodes an email header for use with RTSmtpClient.SendEmail(MailAddress, IEnumerable<MailAddress>, IEnumerable<string>, string, string), escaping, quoting and line-wrapping as required by the relevant RFCs.
string
EncodeHeader(string name, params MailAddress[] addresses)