I'm having trouble implementing an MVC project, specifically the forgot password functionality. When I debug in localhost, everything works as it should, but when I push the project up to my production server, no email ever gets to my account when I do a forgot password request.
I'm using the following code to send my email:
public class EmailService : IIdentityMessageService
{
public Task SendAsync(IdentityMessage message)
{
var client = new SmtpClient();
var mail = new MailMessage();
mail.IsBodyHtml = true;
mail.To.Add(message.Destination);
mail.Subject = message.Subject;
mail.Body = message.Body;
client.SendMailAsync(mail);
return Task.FromResult(0);
}
}
And in my web.config, I have the following mail setting:
<system.net>
<mailSettings>
<smtp deliveryMethod="Network" from="resetpassword@xxxxxxx.com">
<network host="xxxxxxxx" password="xxxxxxx" port="2500" userName="admin@xxxxxx.com" />
</smtp>
</mailSettings>
</system.net>
I'm getting 200s when I look at the http calls in Fiddler, so to apparent error is being thrown. Is this enough info to speculate what I'm missing here?
Thanks.