I have a web application that has a user password login recovery function. I would like to customize the email sending to the user who forgets the password.
I created a PasswordRecoveryMail.txt file under ~/Myfolder/PasswordRecoveryMail.txt I pointed file in the PasswordRecovery1_SendingMail Event.
e.Message.CC.Add("MyEmail Address");
e.Message.Subject = "Your password has been reset ...";
}
As a result, I received the email with correct the email Subject, But the email content keeps the default not what I created in the PasswordRecoveryMail.txt.
As a result, I received the email with correct the email Subject, But the email content keeps the default not what I created in the PasswordRecoveryMail.txt.
The symptom indicates you the code is still pointing to the old PasswordRecoveryMail.txt file. Did you forget to deploy the file? Perhaps simply set a break point and step through your code. I'm sure you'll be able to locate the bug.
Member
25 Points
193 Posts
Password Recovery in Web using ASP.NET
Mar 11, 2020 02:46 PM|SMDQVTMM|LINK
I have a web application that has a user password login recovery function. I would like to customize the email sending to the user who forgets the password.
I created a PasswordRecoveryMail.txt file under ~/Myfolder/PasswordRecoveryMail.txt I pointed file in the PasswordRecovery1_SendingMail Event.
protected void PasswordRecovery1_SendingMail(object sender, MailMessageEventArgs e)
{
PasswordRecovery1.MailDefinition.BodyFileName = "~/Myfolder/PasswordRecoveryMail.txt";
e.Message.CC.Add("MyEmail Address");
e.Message.Subject = "Your password has been reset ...";
}
As a result, I received the email with correct the email Subject, But the email content keeps the default not what I created in the PasswordRecoveryMail.txt.
What did I miss? Thanks.
All-Star
53711 Points
24041 Posts
Re: Password Recovery in Web using ASP.NET
Mar 11, 2020 03:02 PM|mgebhard|LINK
The symptom indicates you the code is still pointing to the old PasswordRecoveryMail.txt file. Did you forget to deploy the file? Perhaps simply set a break point and step through your code. I'm sure you'll be able to locate the bug.
Member
25 Points
193 Posts
Re: Password Recovery in Web using ASP.NET
Mar 11, 2020 04:21 PM|SMDQVTMM|LINK
megehard,
I did deploy the file. It seems it does not pass the content of the file into the message.Body. thanks.
Member
25 Points
193 Posts
Re: Password Recovery in Web using ASP.NET
Mar 11, 2020 07:39 PM|SMDQVTMM|LINK
After I point BodyFilename in the source code, then it works. Thanks.