Smtp.ConnectAsync Method
Namespace: Rebex.Net
Assembly: Rebex.Smtp.dll (version 7.0.9119)
ConnectAsync(String, Object)
Begins asynchronous Connect operation. Connects to the SMTP server.
Declaration
public Task<string> ConnectAsync(string serverName, object state = null)
Parameters
Type | Name | Description |
---|---|---|
String | serverName | The server address - either a hostname or a dotted string address. |
Object | state | An optional user-provided object that identifies this particular asynchronous operation. |
Returns
Type | Description |
---|---|
Task<String> | Welcome message returned by the server. |
ConnectAsync(String, Int32, Object)
Begins asynchronous Connect operation. Connects to the SMTP server.
Declaration
public Task<string> ConnectAsync(string serverName, int serverPort, object state = null)
Parameters
Type | Name | Description |
---|---|---|
String | serverName | The server address - either a hostname or a dotted string address. |
Int32 | serverPort | The server port (e.g. 25). |
Object | state | An optional user-provided object that identifies this particular asynchronous operation. |
Returns
Type | Description |
---|---|
Task<String> | The welcome message returned by the server. |
ConnectAsync(String, Int32, SslMode, Object)
Begins asynchronous Connect operation. Connects to the SMTP server with the specified security.
Declaration
public Task<string> ConnectAsync(string serverName, int serverPort, SslMode security, object state = null)
Parameters
Type | Name | Description |
---|---|---|
String | serverName | The server address - either a hostname or a dotted string IP address. |
Int32 | serverPort | The server port (e.g. 25). |
SslMode | security | Connection security. |
Object | state | An optional user-provided object that identifies this particular asynchronous operation. |
Returns
Type | Description |
---|---|
Task<String> | The welcome message returned by the server. |
ConnectAsync(String, SslMode, Object)
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.
Declaration
public Task<string> ConnectAsync(string serverName, SslMode security, object state = null)
Parameters
Type | Name | Description |
---|---|---|
String | serverName | The server address - either a hostname or a dotted string IP address. |
SslMode | security | Connection security. |
Object | state | An optional user-provided object that identifies this particular asynchronous operation. |
Returns
Type | Description |
---|---|
Task<String> | The welcome message returned by the server. |