The Smtp type exposes the following members.

Constructors

  NameDescription
Public methodSmtp()()()()
Initializes new instance of the Smtp class.
Public methodSmtp(AddressFamily)
Initializes new instance of the Smtp class.

Methods

  NameDescription
Public methodAttach(Socket)
Attaches client to specified socket.
(Inherited from TcpTextClient.)
Public methodAttach(Socket, Boolean)
Attaches client to specified socket.
(Inherited from TcpTextClient.)
Public methodAttachSSL
Attaches client to specified socket.
(Inherited from TcpTextClient.)
Public methodClose()()()()
Issues quit command (CloseCommand()()()() method), closes the connection, disposes the object.
(Inherited from TcpTextClient.)
Public methodClose(Boolean)
Issues quit command (CloseCommand()()()() method) and closes the connection.
(Inherited from TcpTextClient.)
Protected methodCloseCommand
Sends the Quit command. And gets server response.
(Overrides TcpTextClient..::..CloseCommand()()()().)
Public methodConnect(String)
Connects to SMTP server on port 25. Use ConnectSSL(String) when SSL connection is needed.
Public methodConnect(IPEndPoint, Boolean)
Connects to server.
(Inherited from TcpTextClient.)
Public methodConnect(String, Int32)
Connects to server. Use ConnectSSL(String, Int32) when SSL connection is needed.
(Inherited from TcpTextClient.)
Public methodConnect(IPAddress, Int32, Boolean)
Connects to server.
(Inherited from TcpTextClient.)
Public methodConnect(String, Int32, Boolean)
Connects to server.
(Inherited from TcpTextClient.)
Public methodConnectSSL(String)
Connects to SMTP server using SSL on port 465.
Public methodConnectSSL(String, Int32)
Connects to server using SSL.
(Inherited from TcpTextClient.)
Public methodData()()()()
Sends "DATA" command.
Public methodData(Boolean)
Sends "DATA" command.
Public methodDispose
Releases all resources acquired by this object. Closes connection, without issuing any quit commands.
(Inherited from TcpTextClient.)
Public methodEhlo()()()()
Says hello to the server. Uses local IP address as domain name. This command is sent automatically you don't need to resend it.
Public methodEhlo(String)
Sends EHLO (Extended HELO) to the server.
Public methodEhlo(HeloType, String)
Says hello to the server.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Protected methodGetServerGreeting
Receives server's greeting.
(Overrides TcpTextClient..::..GetServerGreeting()()()().)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodHelo
Sends HELO to the server.
Public methodLogin
Logs user in using AUTH LOGIN command. This method sends the password in clear text (BASE64), unless SSL connection is used.
Public methodLoginCRAM
Logs user in using AUTH CRAM-MD5 command. This method does NOT send the password in clear text.
Public methodLoginDIGEST
Logs user in using AUTH DIGEST-MD5 command. This method does NOT send the password in clear text.
Public methodLoginOAUTH
Logs user in using AUTH XOAUTH command. This method does NOT send the password. You can use OAuth class to create the key.
Public methodLoginPLAIN(String, String)
Logs user in using AUTH PLAIN command. This method sends the password in clear text (BASE64), unless SSL connection is used.
Public methodLoginPLAIN(String, String, String)
Logs user in using AUTH PLAIN command. This method sends the password in clear text (BASE64), unless SSL connection is used.
Public methodMailFrom(String)
Sends "MAIL FROM:" command.
Public methodMailFrom(String, Boolean)
Sends "MAIL FROM:" command.
Public methodMailFrom(String, List<(Of <<'(CommandParameter>)>>), Boolean)
Sends "MAIL FROM:" command.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodRcptTo(String)
Sends "RCPT TO:" command.
Public methodRcptTo(String, Boolean)
Sends "RCPT TO:" command.
Public methodRcptTo(String, List<(Of <<'(CommandParameter>)>>), Boolean)
Sends "RCPT TO:" command.
Public methodSend
Sends the text command to server. Adds "\r\n" to the command.
(Inherited from TcpTextClient.)
Public methodSendCommand(String)
Sends command which expects to receive multi-line response e.g. "EHLO".
Public methodSendCommand(String, Boolean)
Sends command which expects to receive multi-line response e.g. "EHLO".
Public methodSendMessage(IMail)
Sends single message.
Public methodSendMessage(ISmtpMail)
Sends single message.
Public methodSendMessage(IMail, Boolean)
Sends single message.
Public methodSendMessage(ISmtpMail, Boolean)
Sends single message.
Public methodStartTLS
Sends 'STARTTLS' command and initializes SSL connection (issues EHLO command).
Public methodSupportedAuthenticationMethods
Lists authentication methods supported by the remote server.
Public methodSupportedExtensions
Lists extensions supported by the remote server (e.g. STARTTLS)
Protected methodSwitchToSSL
Switches to SSL stream, authenticates as client.
(Inherited from TcpTextClient.)
Public methodToString
Returns a String that represents the current Object.
(Inherited from Object.)
Public methodUseBestLogin
Logs user in using best available method.

Fields

  NameDescription
Public fieldStatic memberDefaultPort
Default SMTP protocol port (25). If you need to use different port please use port parameter in Connect(String, Int32) or Connect(String, Int32, Boolean) method.
Public fieldStatic memberDefaultSSLPort
Default SMTP protocol over SSL port (465). If you need to use different port please use port parameter in ConnectSSL(String, Int32) or Connect(String, Int32, Boolean) method.

Properties

  NameDescription
Public propertyConnected
Gets a value indicating whether the underlying Socket is connected to a remote host.
(Inherited from TcpTextClient.)
Public propertyDeliveryNotification
Gets or sets the delivery notification options for email.
Public propertyReader
StreamReader used for reading from network stream or SSL stream.
(Inherited from TcpTextClient.)
Public propertyReceiveTimeout
Gets or sets the amount of time a TcpClient will wait to receive data once a read operation is initiated.
(Inherited from TcpTextClient.)
Public propertySendTimeout
Gets or sets the amount of time a TcpClient will wait for a send operation to complete successfully.
(Inherited from TcpTextClient.)
Public propertySocket
Gets the underlying Socket.
(Inherited from TcpTextClient.)
Public propertySSLConfiguration
Represents SSL configuration (client certificates, enabled SSL protocols).
(Inherited from TcpTextClient.)
Public propertySSLStream
Gets SslStream or null if SSL is not enabled.
(Inherited from TcpTextClient.)
Public propertyStream
Gets SslStream or NetworkStream for current connection.
(Inherited from TcpTextClient.)
Public propertyWriter
StringWriter used for writing to network stream or SSL stream.
(Inherited from TcpTextClient.)

Events

  NameDescription
Public eventServerCertificateValidate
Event which is called for custom server certificate validation.
(Inherited from TcpTextClient.)

See Also