Catalyst Internet Mail .NET

InternetMail.Connect Method (String, Int32, String, String, Int32, InternetMailOptions)

Establish a connection with a mail server.

[Visual Basic]
Overloads Public Function Connect( _
   ByVal hostName As String, _
   ByVal hostPort As Integer, _
   ByVal userName As String, _
   ByVal userPassword As String, _
   ByVal timeout As Integer, _
   ByVal options As InternetMailOptions _
) As Boolean
[C#]
public bool Connect(
   string hostName,
   int hostPort,
   string userName,
   string userPassword,
   int timeout,
   InternetMailOptions options
);

Parameters

hostName
A string which specifies the remote host to establish a connection with. This may specify a host name or an Internet address in dot-notation.
hostPort
An integer which specifies the port number for the connection. This value must be greater than zero and the maximum valid port number is 65535.
userName
A string which specifies a username used to authenticate the client session.
userPassword
A string which specifies the password used to authenticate the client session.
timeout
An integer value that specifies the number of seconds that the method will wait for the connection to complete before failing the operation and returning to the caller.
options
One or more of the InternetMailOptions enumeration flags.

Return Value

A boolean value which specifies if the connection has been established. A return value of true indicates that the connection has completed and the application may exchange data with the mail server. If this method returns false, the connection could not be established and the application should check the value of the LastError property to determine the cause of the failure.

See Also

InternetMail Class | SocketTools Namespace | InternetMail.Connect Overload List