Using Google SMTP with Supabase Custom SMTP

Last edited: 2/21/2025

Hey everyone, i've been hearing feedback about how challenging it can be to get google SMTP working properly with Supabase. I've tried setting this up with a trial google workspace account and this is what i've discovered.

  1. The sender email and SMTP username has to be your google workspace admin email.
  2. The SMTP password used has to be an app password. Google workspace doesn't make it easy to to figure out how to create this. You need to enable 2FA on your workspace account first (not inside the admin console but in https://myaccount.google.com/)
  3. If you want to use smtp-relay.gmail.com only port 465 works. If you want to use smtp.gmail.com, you can use port 465 or 587. The following screenshots show what those steps look like:

For smtp-relay.gmail.com

image

(The "Require TLS encryption" option didn't seem to affect anything when tested)image

For smtp.gmail.com

image

A lot of this was figured out through trial and error. This is unlikely to be a Supabase Auth bug because Supabase Auth uses the native Golang SMTP library . If you still have issues setting up Google SMTP, you can try switching to one of these SMTP providers: