Hi
I am having a weird problem and I am not sure why.
I have this in my webconfig
<add key="SMTP" value="mail.reliablesite.net"/>
<add key="Email" value="Email"/>
<add key="EMAIL_PASSWORD" value="Password"/>
<add key="FROM_PORT" value="2525"/>
Now when I test smtp through localhost all is well and sends my smtp and everything. I upload my webconfig plus all my other files and I try to test my smtp and no message is sent. Exact same code and everything.
So I don't understand why this does not work.
This is like a condensed version of my code.
public class MyTestController : Controller
{
//
// GET: /MyTest/
public void Index()
{
MailMessage mail = new MailMessage();
mail.From = new MailAddress("From");
mail.To.Add("To");
mail.Subject = "subject";
mail.IsBodyHtml = true;
mail.Body = "body";
NetworkCredential credential = new NetworkCredential("EmailFromMyHostingSite", "Password");
SmtpClient smtp = new SmtpClient();
smtp.Host = "mail.reliablesite.net";
smtp.Port = 2525;
smtp.Credentials = credential;
smtp.Send(mail);
mail.Dispose();
}
}