Syntax
| C# |
|---|
public class Smtp |
| Visual Basic (Declaration) |
|---|
Public Class Smtp |
| Visual C++ |
|---|
public ref class Smtp |
The type exposes the following members.
Public Constructors
| Name | Description | |
|---|---|---|
| SmtpSmtpNew |
Creates new Smtp client object.
Sets ReceiveTimeout to 5 sec.
|
Public Methods
| Name | Description | |
|---|---|---|
| BeginConnect | Overloaded. | |
| Close | Overloaded. | |
| Connect | Overloaded. | |
| ConnectSSL |
Connects to SMTP server using SSL on port 465.
| |
| Data |
Sends "DATA" command.
| |
| Ehlo | Overloaded. | |
| EndConnect | Asynchronously accepts an incoming connection attempt. (Inherited from TcpClient.) | |
| Equals | (Inherited from Object.) | |
| GetHashCode | Serves as a hash function for a particular type. GetHashCode()() is suitable for use in hashing algorithms and data structures like a hash table. (Inherited from Object.) | |
| GetStream |
Gets SslStream or NetworkStream for current connection.
(Inherited from TcpTextClient.) | |
| GetType | Gets the Type of the current instance. (Inherited from Object.) | |
| Helo |
Sends HELO to the server.
| |
| Login |
Logs user in.
| |
| MailFrom |
Sends "MAIL FROM:" command.
| |
| RcptTo |
Sends "RCPT TO:" command.
| |
| ReceiveLine |
Reads data from server until gets "\r\n" string.
(Inherited from TcpTextClient.) | |
| ReceiveMultiLine |
Recives mult-line response from server.
| |
| Send |
Sends the text command to server.
Adds "\r\n" to the command.
(Inherited from TcpTextClient.) | |
| SendCommand | Overloaded. | |
| SendMessage |
Sends single message.
| |
| StartTLS |
Sends 'STARTTLS' command and initializes SSL connection.
| |
| ToString | (Inherited from Object.) |
Protected Methods
| Name | Description | |
|---|---|---|
| CloseCommand |
Sends the Quit command. And gets server response.
(Overrides TcpTextClient..::CloseCommand()().) | |
| CreateSSLStream |
Creates SSL stream.
and authenticates client.
(Inherited from TcpTextClient.) | |
| Dispose | Releases the unmanaged resources used by the TcpClient and optionally releases the managed resources. (Inherited from TcpClient.) | |
| Finalize | Frees resources used by the TcpClient class. (Inherited from TcpClient.) | |
| GetServerGreeting |
Receives server's greeting.
(Overrides TcpTextClient..::GetServerGreeting()().) | |
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
| OnSendProgress |
Raises the SendProgress event.
| |
| SetStreams |
Creates new Reader and
Writer objects.
With specified encoding.
Reader: Default Encoding;
Writer: ASCII Encoding.
(Overrides TcpTextClient..::SetStreams()().) |
Public Fields
| Name | Description | |
|---|---|---|
| Reader |
StreamReader used for reading from network stream or SSL stream.
(Inherited from TcpTextClient.) | |
| Writer |
StringWriter used for writing to network stream or SSL stream.
(Inherited from TcpTextClient.) |
Public Properties
| Name | Description | |
|---|---|---|
| Available | Gets the amount of data that has been received from the network and is available to be read. (Inherited from TcpClient.) | |
| Client | Gets or sets the underlying Socket. (Inherited from TcpClient.) | |
| Connected | Gets a value indicating whether the underlying Socket for a TcpClient is connected to a remote host. (Inherited from TcpClient.) | |
| ExclusiveAddressUse | Gets or sets a Boolean value that specifies whether the TcpClient allows only one client to use a port. (Inherited from TcpClient.) | |
| LingerState | Gets or sets information about the sockets linger time. (Inherited from TcpClient.) | |
| NoDelay | Gets or sets a value that disables a delay when send or receive buffers are not full. (Inherited from TcpClient.) | |
| Password |
User's password.
| |
| ProgressThreshold |
Says how often ReceiveProgress event will be raised.
In bytes.
| |
| ReceiveBufferSize | Gets or sets the size of the receive buffer. (Inherited from TcpClient.) | |
| ReceiveTimeout | Gets or sets the amount of time a TcpClient will wait to receive data once a read operation is initiated. (Inherited from TcpClient.) | |
| SendBufferSize | Gets or sets the size of the send buffer. (Inherited from TcpClient.) | |
| SendTimeout | Gets or sets the amount of time a TcpClient will wait for a send operation to complete successfully. (Inherited from TcpClient.) | |
| SSLStream |
Returns used SslStream or null if SSL is not enbled.
(Inherited from TcpTextClient.) | |
| User |
Username.
|
Protected Properties
| Name | Description | |
|---|---|---|
| Active | Gets or set a value that indicates whether a connection has been made. (Inherited from TcpClient.) |
Public Events
| Name | Description | |
|---|---|---|
| SendProgress |
Event fired by ReciveMultiLine method.
You can obtain how many bytes where already recieved.
| |
| ServerCertificateValidate |
Event which is called for custom server validation.
(Inherited from TcpTextClient.) |
See Also
Lesnikowski.Client Namespace