Send_password_reset_email not working anymore

For user login we provide to get changed the password if forgotten and it did the job.

anvil.users.send_password_reset_email(self.text_box_email.text)

Now we get an error:
anvil.email.SendFailure: Invalid Addresses (SendFailedException). You have enabled Custom SMTP for email sending - did you configure it correctly? You may need to provide a valid from_address.

Custom SMTP setting is fine:

Can you please check, if there is a bug in send_password_reset_email or what else we could do.

Follow this,

  1. Users service
  2. Configure emails from the users service
    under from_address put your custom email address

Let me know if it works!

3 Likes

Thank you - that did the job. Great.

1 Like

Always happy to help.

I know this is an older thread, but my problem is recent and this fixes it.

I tried setting the from address as instructed above but for some reason it was not applied to the email. BTW - I upgraded to hobby to be able to set the from address. It still did not work.

Checking my email server I was getting this message:

Email Server Message

So I went to the Custom Sign Up Flow that I had added to my dependencies and in the ServerModule1 / def _send_email_confirm_link(email): function

I modified the call to the anvil.email.send function to include a from_address header to include my server user address.

anvil.email.send(to=user['email'], subject="Confirm your email address", from_address="Jim@xyzxyz.com", text=f"""

I removed the installed dependency and reinstalled the edited dependency.

Works flawlessly now.

1 Like