IPAddress hostIPAddress = IPAddress.Parse("130.23.43.234");
IPAddress theAddress = new IPAddress(hostIPAddress);
CEmailServer theServer = new CEmailServer (theAddress);
if (theServer.Connect ())
{
CMailbox theMailbox = theServer.GetMailbox ("stevencl");
theMailbox.Open("stevencl", true);
CEmailMessage theMessage = theMailbox.NewMessage();
theMessage.Build("message", " subject", "to@you.com");
theMailbox.Send (theMsg, true);
theMailbox.Close();
}
else
Console.WriteLine ("Could not connect to the mail server");
Example 2: Using an API to create/send a new e-mail message.
Back to Article