Custom SMTP no longer works with google workspace

Hi,

I have been running a custom smtp successfully for several years. Now it seems (as of March 2025) that google has reverted the support for “less secure apps” - please see link below.

Transition from less secure apps to OAuth - Google Workspace Admin Help?

How can i still use custom smtp with anvil, but using googles recommendations - oauth.

Thanks!

This just isn’t supported by Google anymore. You can still send emails via the GMail API, but Google tends to discourage the use of GMail for sending email. I recommend you checkout actual SMTP services such as Sendgrid or Mailjet, the latter of which has a free plan.

2 Likes

Hi @brooke

Thanks for your answer :slight_smile:

I just want to show how it looks like in eg Synology NAS. When configuring a email sender, one can sign in with eg google account (oauth).
Would be great to have the similiar options in Anvil :slight_smile: But i guess thats perhaps a feature request.

1 Like

Hi @tobias.carlbom,

You can still send email with Google’s API, which is what Synology is doing. It’s also something you can do in Anvil with anvil.google.mail.send()

You can no longer send emails with Google via SMTP, so using your Google account as a Custom SMTP target no longer works.

Anvil’s email system is pretty tied to the feature set of SMTP, so moving all email sending to be able to go via the Google API is a fairly significant piece of work. Google APIs often change and break, which has already caused us problems in the past with other Google features.

However, you are welcome to make a feature request on the forum, and if it’s a popular request, we’ll look into implementing it!

1 Like

Thanks @brooke !

I didnt know about anvil.google.mail.send method :slight_smile:
Will definitely look into that!