I setup a private email with my namecheap domain but I am having trouble sending e-mails. Below is my code. Am I missing anything? I get a timeout message each time.
//Send email to end user
MailMessage mm = new MailMessage();
foreach(string to in toList)
{
mm.To.Add(to);
}
mm.From = new System.Net.Mail.MailAddress("fromaddress");
mm.Subject = subject;
mm.Body = body;
mm.IsBodyHtml = true;
var smtp = new SmtpClient
{
Host = "mail.privateemail.com",
Port = 465,
EnableSsl = true,
DeliveryMethod = SmtpDeliveryMethod.Network,
Credentials = new NetworkCredential("username", "pw"),
Timeout = 20000
};
smtp.Send(mm);