MailMessage mail = new MailMessage();
mail.From = new MailAddress("from email");
mail.To.Add("to email address");
mail.Subject = subject;
mail.IsBodyHtml = true;
mail.Body = body;
mail.Priority = System.Net.Mail.MailPriority.High;
SmtpClient smtp = new SmtpClient("username", 465);
smtp.EnableSsl = true;
NetworkCredential SMTPUserInfo = new NetworkCredential("username", "password");
smtp.Credentials = SMTPUserInfo;
smtp.Send(mail);
CDO.Message message = new CDO.Message();
CDO.IConfiguration configuration = message.Configuration;
ADODB.Fields fields = configuration.Fields;
field.Value = "smtp.zoho.com";
field.Value = 465;
field.Value = CDO.CdoSendUsing.cdoSendUsingPort;
field.Value = CDO.CdoProtocolsAuthentication.cdoBasic;
field.Value ="username";
field.Value = "password";
field.Value = "true";
fields.Update();
Console.WriteLine(String.Format("Building CDO Message..."));
message.From ="from email";
message.To = "to email";
message.Subject = "Test message.";
message.TextBody = "This is a test message. Please disregard.";
Console.WriteLine(String.Format("Attempting to connect to remote server..."));
// Send message.
message.Send();