Opens a connection to an SMTP server.
Opens a connection to an SMTP server at the default port.
public void Connect(string);
Opens a connection to an SMTP server at a specified port.
public void Connect(string,int);
This method opens a connection to the SMTP server on the host at network address address and TCP port port. The address parameter may be either a hostname, such as "smtp.example.com", or an IP address in dotted decimal form, such as "192.168.2.25". The default value for port is 25, the well-known port number for SMTP assigned by the Internet Assigned Numbers Authority (IANA).
If the client fails to connect to the server -- for example,
if the host is not found or some other network error occurs -- then
Connect throws an instance of Hunny.Mail.Exception. If
Connect returns successfully, then you should check the
server's reply code, available as the ReplyCode property. The server sends a 220
reply code if it is ready to process commands.
You may call the Cancel method from another thread to cancel this operation.
Note: The cancel operation will not have an immediate effect if the connect operation is waiting on a hostname lookup. Failed hostname lookups always time out. (In a future implementation, the library may provide the capability to cancel a hostname lookup, as well.)
SmtpClient Class | Hunny.Mail Namespace