C# Class org.GraphDefined.Vanaheimr.Hermod.SMTP.SMTPClient

A SMTP client for sending e-mails.
Inheritance: org.GraphDefined.Vanaheimr.Hermod.Sockets.TCP.TCPClient
显示文件 Open project: Vanaheimr/Hermod Class Usage Examples

Public Properties

Property Type Description
Capabilities SmtpCapabilities

Public Methods

Method Description
Dispose ( ) : void
SMTPClient ( String RemoteHost, IPPort RemotePort, String Login = null, String Password = null, String LocalDomain = null, System.Boolean UseIPv4 = true, System.Boolean UseIPv6 = false, System.Boolean PreferIPv6 = false, TLSUsage UseTLS = TLSUsage.STARTTLS, ValidateRemoteCertificateDelegate ValidateServerCertificate = null, System.TimeSpan ConnectionTimeout = null, DNSClient DNSClient = null, System.Boolean AutoConnect = false, CancellationToken CancellationToken = null ) : System

Create a new SMTP client for sending e-mails.

Send ( AbstractEMailBuilder MailBuilder, Byte NumberOfRetries = 3, System.Boolean AutoStart = true ) : Task
Send ( EMail EMail, Byte NumberOfRetries = 3, System.Boolean AutoStart = true ) : Task
Send ( EMailEnvelop EMailEnvelop, Byte NumberOfRetries = 3, System.Boolean AutoStart = true ) : Task

Protected Methods

Method Description
ReadSMTPResponses ( ) : IEnumerable
SendCommand ( String Command ) : void
SendCommandAndWait ( String Command ) : SMTPExtendedResponse
SendCommandAndWaits ( String Command ) : IEnumerable

Private Methods

Method Description
GenerateMessageId ( EMail Mail, String DomainPart = null ) : MessageId
ReadSMTPResponse ( ) : SMTPExtendedResponse

Method Details

Dispose() public method

public Dispose ( ) : void
return void

ReadSMTPResponses() protected method

protected ReadSMTPResponses ( ) : IEnumerable
return IEnumerable

SMTPClient() public method

Create a new SMTP client for sending e-mails.
public SMTPClient ( String RemoteHost, IPPort RemotePort, String Login = null, String Password = null, String LocalDomain = null, System.Boolean UseIPv4 = true, System.Boolean UseIPv6 = false, System.Boolean PreferIPv6 = false, TLSUsage UseTLS = TLSUsage.STARTTLS, ValidateRemoteCertificateDelegate ValidateServerCertificate = null, System.TimeSpan ConnectionTimeout = null, DNSClient DNSClient = null, System.Boolean AutoConnect = false, CancellationToken CancellationToken = null ) : System
RemoteHost String
RemotePort IPPort
Login String
Password String
LocalDomain String
UseIPv4 System.Boolean Whether to use IPv4 as networking protocol.
UseIPv6 System.Boolean Whether to use IPv6 as networking protocol.
PreferIPv6 System.Boolean Prefer IPv6 (instead of IPv4) as networking protocol.
UseTLS TLSUsage Whether Transport Layer Security should be used or not.
ValidateServerCertificate ValidateRemoteCertificateDelegate A callback for validating the remote server certificate.
ConnectionTimeout System.TimeSpan The timeout connecting to the remote service.
DNSClient DNSClient An optional DNS client used to resolve DNS names.
AutoConnect System.Boolean Connect to the TCP service automatically on startup. Default is false.
CancellationToken System.Threading.CancellationToken
return System

Send() public method

public Send ( AbstractEMailBuilder MailBuilder, Byte NumberOfRetries = 3, System.Boolean AutoStart = true ) : Task
MailBuilder AbstractEMailBuilder
NumberOfRetries Byte
AutoStart System.Boolean
return Task

Send() public method

public Send ( EMail EMail, Byte NumberOfRetries = 3, System.Boolean AutoStart = true ) : Task
EMail org.GraphDefined.Vanaheimr.Hermod.Mail.EMail
NumberOfRetries Byte
AutoStart System.Boolean
return Task

Send() public method

public Send ( EMailEnvelop EMailEnvelop, Byte NumberOfRetries = 3, System.Boolean AutoStart = true ) : Task
EMailEnvelop org.GraphDefined.Vanaheimr.Hermod.Mail.EMailEnvelop
NumberOfRetries Byte
AutoStart System.Boolean
return Task

SendCommand() protected method

protected SendCommand ( String Command ) : void
Command String
return void

SendCommandAndWait() protected method

protected SendCommandAndWait ( String Command ) : SMTPExtendedResponse
Command String
return SMTPExtendedResponse

SendCommandAndWaits() protected method

protected SendCommandAndWaits ( String Command ) : IEnumerable
Command String
return IEnumerable

Property Details

Capabilities public_oe property

public SmtpCapabilities Capabilities
return SmtpCapabilities