using VS2017 c# v4.6.1 ? in a web forms project (with MVC) trying to implement security and have to make the email the forgotten password link work; I did in the past and created a custom gmail account and set that up in the web.config,
In the webforms I uncommented the forgot and reset password? So in the login screen Forgot Password says it works but doesnt send anything. It validates the user is in the system (setup before this app), not sure how it verifies but in the IF block, it
passes the test that the user is verified and goes to send the email but no emails are received.
so far just copied across the web.config of the gmail settings from a previous working project
public class EmailService : IIdentityMessageService
{
public Task SendAsync(IdentityMessage message)
{
// Plug in your email service here to send an email.
return Task.FromResult(0);
}
}
To send email you have to plug in the code that does the email
public Task SendAsync(IdentityMessage message)
{
// Plug in your email service here to send an email.
return configSendGridasync(message);
}
Then add the method
private Task configSendGridasync(IdentityMessage message)
{
MailMessage mailMsg = new MailMessage();
// To
mailMsg.To.Add(new MailAddress(message.Destination.ToString(), "To Name"));
It will need these namespaces
using System.Net.Mail;
using System.Net.Mime;
more detail: https://github.com/sendgrid/sendgrid-csharp/issues/315
Member
126 Points
873 Posts
How to get asp.net Email forgot password Authentication to work?
Jan 25, 2019 05:49 AM|rogersbr|LINK
using VS2017 c# v4.6.1 ? in a web forms project (with MVC) trying to implement security and have to make the email the forgotten password link work; I did in the past and created a custom gmail account and set that up in the web.config,
In the webforms I uncommented the forgot and reset password? So in the login screen Forgot Password says it works but doesnt send anything. It validates the user is in the system (setup before this app), not sure how it verifies but in the IF block, it passes the test that the user is verified and goes to send the email but no emails are received.
so far just copied across the web.config of the gmail settings from a previous working project
Member
126 Points
873 Posts
Re: How to get asp.net Email forgot password Authentication to work?
Jan 25, 2019 04:35 PM|rogersbr|LINK
To send email you have to plug in the code that does the email
Then add the method
It will need these namespaces
using System.Net.Mail;
using System.Net.Mime;
more detail: https://github.com/sendgrid/sendgrid-csharp/issues/315