On my website i send e-mails. My situation is these mails are being sent when using my local development machine, and not on my production environment.
The web.config is the same on both sites:
<system.net>
<mailSettings>
<smtp from="info@domain.dk" deliveryMethod="Network">
<network host="mail.domain.dk" userName="info@domain.dk" password="mypassword" port="26"></network>
</smtp>
</mailSettings>
</system.net>
In my code, I send it like this:
SmtpClient client = new SmtpClient();
client.Send(mail);
I have no idea how to debug this problem, as it is the exactly same code on both production and development.
Any ideas on how to start debugging / solving the problem?
EDIT:
I managed to get a log from the server. Error is:
2012-11-01 20:41:58,383 [11] FATAL GKBusiness.Managers.MailManager [(null)] - Email exception: Mailbox unavailable. The server response was: Access denied - Invalid HELO name (See RFC2821 4.1.1.1)
Hmm
If you are in a shared hosting environment, it’s likely that ASP.Net is set to
Medium Trust– and if so, SMTP is restricted to port 25.It will work in your local environment because ASP.Net is set to
Full Trust(in local/VS dev).