I know this question has been done to death but none that I've found here answer the question.
I have the following code in my controller;
SmtpClient smtpClient = new SmtpClient();
try
{
smtpClient.Host = "smtpout.secureserver.net";
smtpClient.Port = 25;
smtpClient.Timeout = 10000;
smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;
smtpClient.UseDefaultCredentials = false;
smtpClient.Credentials = new NetworkCredential("
[email protected]", "EmailPassword");
String bodyText = fvm.ContactNumber + "\n" + fvm.EmailAddress + "\n" + fvm.FirstName + " " + fvm.LastName + "\n" + fvm.Comments;
MailMessage mailMessage = new MailMessage("
[email protected]", "
[email protected]", fvm.Reason, bodyText);
mailMessage.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;
smtpClient.Send(mailMessage);
}
catch(Exception ex) { }
This code works great in dev on my local box but won't send when published on the
GoDaddy server.
Does anyone know how to send Email from GoDaddy?