Smtp Class
Namespace: Rebex.Net
Assembly: Rebex.Smtp.dll (version 7.0.9147)
Provides methods for communication with SMTP servers.
Syntax
public class Smtp : NetworkSession, ILogWriterProvider, IDisposable
Inherited Members
Remarks
All members of this class are thread-safe.
Constructors
Name | Description |
---|---|
Smtp() | Initializes a new instance of the Smtp class. |
Fields
Name | Description |
---|---|
Alternative |
Alternative SMTP/Explicit SSL port (587). |
Default |
Default SMTP/Implicit SSL port (465). |
Default |
Default SMTP port (25). |
Properties
Name | Description |
---|---|
Abort |
Gets or sets the length of time before the abort operation times out. |
Client |
Gets or sets the domain announced by the client. |
Default |
Gets or sets a default log writer used by all new instances of Network |
Delivery |
Gets or sets the bit field specifying the conditions under which the SMTP server should generate and send a delivery status notification (DSN) messages. |
Delivery |
Gets or sets the value indicating to the SMTP server whether it should attach the entire original message or headers only. |
Enabled |
Gets or sets the bit field specifying the enabled extensions. |
Encoding | Gets or sets the Encoding to use to encode and decode command parameters and server responses. |
Instance |
Gets instance ID (intended for logging purposes).
Inherited from Network |
Is |
Returns a value indicating whether the session is authenticated. |
Is |
Gets a value indicating whether there any operation (method) in progress. |
Is |
Gets a value indicating whether the session is connected. |
Is |
Gets the value indicating whether the control connection is secured. |
Local |
Gets the local client End |
Log |
Gets or sets the Log |
Max |
Gets the maximum mail message size announced by the server. |
Proxy | Gets or sets the network proxy to use to access a remote server. |
Remote |
Gets the remote server End |
Server |
Gets the domain announced by the server. |
Server |
Gets the server name, if available.
Inherited from Network |
Server |
Gets the server port, if available.
Inherited from Network |
Settings | Gets or sets Smtp object settings. |
State | Gets the current state of the Smtp object. |
Supported |
Gets the bit field specifying the extensions supported by the server. |
Timeout | Gets or sets the length of time in milliseconds before the operation times out (specify -1 or 0 to indicate that the request does not time out). |
Tls |
Returns the TLS/SSL socket of secured control connection. |
User |
Gets the authenticated user name, if available.
Inherited from Network |
Version | Returns the version of the SMTP component. |
Methods
Name | Description |
---|---|
Abort() | Aborts the current operation. |
Check |
Checks whether the SMTP session is still connected. Throws an exception on error. |
Connect(String) | Connects to the SMTP server. |
Connect(String, Ssl |
Connects to the SMTP server with the specified security. Uses port 25 for no SSL, 587 for explicit SSL and 465 for implicit SSL. |
Connect(String, Int32) | Connects to the SMTP server. |
Connect(String, Int32, Ssl |
Connects to the SMTP server with the specified security. |
Connect |
Begins asynchronous Connect operation. Connects to the SMTP server with the specified security. Uses port 25 for no SSL, 587 for explicit SSL and 465 for implicit SSL. |
Connect |
Begins asynchronous Connect operation. Connects to the SMTP server with the specified security. |
Connect |
Begins asynchronous Connect operation. Connects to the SMTP server. |
Connect |
Begins asynchronous Connect operation. Connects to the SMTP server. |
Disconnect() | Informs the server that the connection is about to close and terminates the connection. |
Disconnect |
Begins asynchronous Disconnect operation. Informs the server that the connection is about to close and terminates the connection. |
Dispose() | Disposes the Smtp object and all the socket objects. |
Dispose(Boolean) | Releases the unmanaged resources used by the Smtp and optionally releases the managed resources. |
Finalize() | Finalizer. Called by garbage collector during object destruction. |
Get |
Checks whether the SMTP session is still connected and returns its state. |
Get |
Gets hash code for this object.
Inherited from Network |
Get |
Gets the list of supported authentication methods. |
Keep |
Sends the NOOP command to the server to keep the connection alive. |
Keep |
Begins asynchronous KeepAlive operation. Sends the NOOP command to the server to keep the connection alive. |
Login(Gss |
Authenticates the user to the SMTP server using the specified GSSAPI provider. Only supported on Windows and partially on Mono. |
Login(Smtp |
Authenticates the user to the SMTP server using the specified authentication method that does not require credentials (NTLM or GSSAPI). Only supported on Windows. |
Login(String, Smtp |
Authenticates the user to the SMTP server using an OAuth token. |
Login(String, String) | Authenticates the user to the SMTP server. |
Login(String, String, Smtp |
Authenticates the user to the SMTP server using the specified authentication method. |
Login |
Begins asynchronous Login operation. Authenticates the user to the SMTP server using the specified GSSAPI provider. Only supported on Windows and partially on Mono. |
Login |
Begins asynchronous Login operation. Authenticates the user to the SMTP server using the specified authentication method that does not require credentials (NTLM or GSSAPI). Only supported on Windows. |
Login |
Begins asynchronous Login operation. Authenticates the user to the SMTP server using an OAuth token. |
Login |
Begins asynchronous Login operation. Authenticates the user to the SMTP server using the specified authentication method. |
Login |
Begins asynchronous Login operation. Authenticates the user to the SMTP server. |
On |
Raises the Command |
On |
Raises the Response |
On |
Raises the State |
On |
Raises the Transfer |
Read |
Returns the response of the SMTP server to the command. |
Read |
Begins asynchronous ReadResponse operation. Returns the response of the SMTP server to the command. |
Resolve |
Retrieves the list of domain's MX records from DNS and returns the list of hosts that accept its email (in order of preference). |
Resolve |
Retrieves the list of domain's MX records from DNS and returns the list of hosts that accept its email (in order of preference). |
Secure() | Secures the connection with TLS/SSL using default parameters. |
Secure |
Begins asynchronous Secure operation. Secures the connection with TLS/SSL using default parameters. |
Send(Mail |
Sends a mail message (Mail |
Send(Mail |
Sends the message using the specified SMTP server. |
Send(Mail |
Sends the message using the specified SMTP server. |
Send(Mail |
Sends the message using the specified SMTP server. |
Send(Mail |
Sends a mail message (Mail |
Send(Mime |
Sends a mail message (Mime |
Send(Mime |
Sends the message using the specified SMTP server. |
Send(Mime |
Sends the message using the specified SMTP server. |
Send(Mime |
Sends the message using the specified SMTP server. |
Send(Mime |
Sends a mail message (Mime |
Send(Stream) | Reads and sends a mail message from the specified stream in MIME format. |
Send(Stream, String, String) | Reads and sends a mail message from the specified stream in MIME format. |
Send(String) | Reads and sends a mail message from the specified local file in MIME format. |
Send(String, Smtp |
Reads a mail message from the specified local file in MIME format and sends it using the specified SMTP server. |
Send(String, String) | Reads a mail message from the specified local file in MIME format and sends it using the specified SMTP server. |
Send(String, String, Int32) | Reads a mail message from the specified local file in MIME format and sends it using the specified SMTP server. |
Send(String, String, String) | Reads and sends a mail message from the specified local file in MIME format. |
Send(String, String, String, String) | Sends a mail message constructed from the specified parameters. |
Send(String, String, String, String, Smtp |
Sends a mail message constructed from the specified parameters using the specified SMTP server. |
Send(String, String, String, String, String) | Sends a mail message constructed from the specified parameters using the specified SMTP server. |
Send(String, String, String, String, String, Int32) | Sends a mail message constructed from the specified parameters using the specified SMTP server. |
Send |
Begins asynchronous Send operation.
Sends a mail message (Mail |
Send |
Begins asynchronous Send operation.
Sends a mail message (Mail |
Send |
Begins asynchronous Send operation.
Sends a mail message (Mime |
Send |
Begins asynchronous Send operation.
Sends a mail message (Mime |
Send |
Begins asynchronous Send operation. Reads and sends a mail message from the specified stream in MIME format. |
Send |
Begins asynchronous Send operation. Reads and sends a mail message from the specified stream in MIME format. |
Send |
Begins asynchronous Send operation. Reads and sends a mail message from the specified local file in MIME format. |
Send |
Begins asynchronous Send operation. Reads and sends a mail message from the specified local file in MIME format. |
Send |
Begins asynchronous Send operation. Sends a mail message constructed from the specified parameters. |
Send |
Executes a command on the SMTP server. |
Send |
Begins asynchronous SendCommand operation. Executes a command on the SMTP server. |
Send |
Sends the message by submitting the message directly to the recipients' SMTP servers. |
Send |
Sends the message by submitting the message directly to the recipients' SMTP servers. |
Send |
Sends a mail message constructed from the specified parameters by submitting it directly to the recipients' SMTP servers. |
Set |
Sets the socket factory to be used to create communication sockets. |
To |
Returns a string representation of this object. |
Events
Name | Description |
---|---|
Command |
Occurs when a command is send to the server. |
Rejected |
Occurs when a recipient is rejected by the server. |
Response |
Occurs when a response is received from the server. |
Sending |
Occurs when a message is sent. |
State |
Occurs when the state of the Smtp object is changed. |
Transfer |
Occurs when data is send or received. |
Validating |
Occurs when a server certificate needs to be validated. |