Custom SMTP Error - bug?

Hi all,

I’m getting the ‘You have enabled Custom SMTP for email sending - did you configure it correctly? You may need to provide a valid from_address.’ error. After searching for forum for the last two hours, I’m hoping someone can assist me.

  • I have setup a custom SMTP and the connection test is ok
  • I have set a valid from_address, which is set to ‘no-reply@myemail.co.uk’, which is the same as the SMTP setup username.
  • I have tried disabling the DKIM on my email side, but the error still occurs

Code Sample:

 anvil.email.send(bcc= e, from_address = "no-reply@myemail.co.uk",
 subject = "subject message",
 html = f"Hello,</b> </b> blah blah blah</b></b>")

Any help is greatly appreciated!

Thanks,
Chris

Update: I am able to send a password reset email from ‘no-reply@myemail.co.uk’ through the Users settings without error. But still cannot send through the server code

Can someone from the Anvil staff assist here? I have spent a lot of time and effort on this app and its very frustrating to have something as simple as a custom SMTP to be stopping this app from publication.

I’m happy to look at an alternative SMTP provider if this looks to be an issue with my current one, but I am hesitant to due the fact I can have a custom email sent through the ‘forgot password’ function in Anvil’s User section - is this a bug?

If you are using the open source server, I am afraid that it is a known bug. You can find more topics about it in the forum.

Sending email with Rest api is an option.

Hi Tony thanks for the reply - but I am not using the open source here. Is there any other reasons why this is not working?

For anyone reading this in the future - my issue was resolved by swapping email provider to Zoho