I'm trying to send mail from my MVC application which is working fine in my local machine. It works well in local, but when I publish it in godaddy, it didn't send any emails and I didn't get any error.
Here is the code. I'm using MVC .net framework
// Attach the file path to the email (if an attachment was saved)
if (!string.IsNullOrEmpty(attachmentFilePath))
{
mm.Attachments.Add(new Attachment(attachmentFilePath));
}
using (var smtp = new SmtpClient
{
Host = "relay-hosting.secureserver.net",
Port = 25,
EnableSsl = false,
UseDefaultCredentials = false,
Credentials = new NetworkCredential("MailAddress", "Password")
})
{
smtp.Send(mm);