We have develop an application that sends email to the user after he confirms a visit to our branch. It works fine when we use the following Gmail configuration: Email: [email protected] Passwd: XXXXX SMTP Server: smtp.gmail.com Port: 587 However, when we try using our domain-based account it simply dosen't work. We are using the following parameters: Email: [email protected] Passwd: XXXXX SMTP Server: smtpout.secureserver.net Port: 465
Code snippet below:
using (System.Net.Mail.MailMessage mm = new System.Net.Mail.MailMessage(from, to))
{
mm.Subject = subject;
mm.Body = body;
mm.IsBodyHtml = false;
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient();
smtp.EnableSsl = true;
NetworkCredential NetworkCred = new NetworkCredential(from, password);
smtp.UseDefaultCredentials = true;
smtp.Credentials = NetworkCred;
smtp.Host = smtpHost;
smtp.Port = smtpPort;
try
{
smtp.Send(mm);
}
catch (Exception ex)
{
throw ex;
}
}
return;
}
Is there anything missing? Suggestions are welcome.
Thx