I have an asp.net 4.0 website (IIS7.5) and I'm using the PasswordRecovery control for a forgot password form. When I run the site locally it works fine, emails are sent. However, when I run the site from my vps (also IIS7.5), I get an error message when trying to send the email. There's nothing in the server's event log.
My PasswordRecovery aspx code is as follows:
<asp:PasswordRecovery ID="PasswordRecovery1" runat="server" CssClass="mediumText"> <MailDefinition From="email@example.com" BodyFileName="~/EmailTemplates/PasswordRecovery.txt" />
My web.config mail settings are as follows:
<system.net> <mailSettings> <smtp from="firstname.lastname@example.org"> <network host="smtp.123-reg.co.uk" password="x" userName="x" /> </smtp> </mailSettings>
I can confirm that I'm able to ping smtp.123-reg.co.uk from the server. I know the username and password are correct because the same config file works when I run the website on my laptop.