locked
Password Recovery in Web using ASP.NET RRS feed

  • Question

  • User-19719568 posted

    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.

    Wednesday, March 11, 2020 2:46 PM

Answers

  • User-19719568 posted

    After I point BodyFilename in the source code, then it works. Thanks.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, March 11, 2020 7:39 PM

All replies

  • User475983607 posted

    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.

    Wednesday, March 11, 2020 3:02 PM
  • User-19719568 posted

    megehard,

    I did deploy the file. It seems it does not pass the content of the file into the message.Body. thanks.

    Wednesday, March 11, 2020 4:21 PM
  • User-19719568 posted

    After I point BodyFilename in the source code, then it works. Thanks.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, March 11, 2020 7:39 PM