Supabase limts access to SMTP service

Ken Fowler

-

Mon Sep 30 2024

blog post image

Introduction

If you're using the Supabase default email provider to handle authentication for your project then you have recently received notice that supabase is providing limited access to their SMTP service for sending transactional emails.

If you want to continue use the default email provider you are going to need to provision your own SMTP service and configure your Supabase project to use it.

Let's learn how to provision and configure an SMTP service so that we can keep using the default email provider authentication provided by supabase.

Overview

I'm going to be using Porkbun as my domain name registrar and AWS SES as my SMTP service, but there are other providers you can use to accomplish the same goal. You can search for the aforementioned services (domain name registrar, SMTP service) and find alternatives.

Here are all the steps we are going to take to get our SMTP service working with Supabase.

  1. Purchase a domain

    • It's required that you have a domain to configure AWS SES.
  2. Configure email for your domain

    • AWS SES will ask you to verify your sending domain and verify your email address. You will need to be able to receive e-mail at your new domain to answer their verification email.
  3. Configure SMTP service

    • there are a few tasks to complete to setup AWS SES
  4. Configure Supabase to use a custom SMTP service

    • last step, you need to point Supabase to your SMTP provider

Process

1. Purchase a domain

This first step is fairly straight forward. Simply head over to your domain name registrar's webpage and checkout a domain name. I used Porkbun to register my domain.

This will give you the ability to manage the DNS records for that domain. You'll need those when configuring your SMTP server as well as to receive mail at your new domain.

2. Configure email for your domain

The next thing you need to do is configure email for your domain. AWS SES is used for sending emails but you need to be able to receive emails at your domain to complete the SES setup.

You can purchase a hosted email service at Porkbun. Alternatively, it may be possible to configure an email service you are already using to receive emails sent to your new domain. For instance, if you have a Google Workspace Account you may be able to add a secondary domain and receive emails there.

3. Configure your SMTP service

The third thing you will need to do is configure the an SMTP service to handle sending your emails. There are a bunch of options out there like:

Resend AWS SES Postmark SendGrid Zepto Mail Brevo

We're going to use AWS SES.

First, search for the SES service in your AWS Console. Navigate to the Get set up section and complete the required tasks: verify email address, verify sending domain, and request production access. It may take some time to have production access approved.

Additionally, you will need to head over to SMTP settings section and Create SMTP credentials. You will need these credentials to authenticate when accessing AWS SES from supabase or any code/service that sends requests to SES.

4. Configure Supabase to use custom SMTP service

The final step is to configure supabase to use your SMTP server instead of the built-in email service. They have some suggestions in their docs with regard to sending emails with custom SMTP.

To configure things, select your project via the Supabase Dashboard -> Project Settings -> Authentication -> scroll down to the SMTP Settings section.

Now, fill in the details:

Sender details

Sender email no-reply@yourdomain.com This is the email address the emails are sent from

Sender name Your Name Name displayed in the recipient's inbox

SMTP Provider Settings

This information will be found with your AWS SES account. The host and port number will be found under the SMTP settings tab. From there you can click Manage existing SMTP credentials to access the username and password that you will need to provide to supabase.

Host example: email-smtp.server-location.amazonaws.com Hostname or IP address of your SMTP server.

Port number example: 587 Port used by your SMTP server. Common ports include 25, 465, and 587.

Username your-username

Password your-password

And that's it, you're done!

Thanks for reading please let feel free to contact me if you have any questions or comments.

Terms

SMTP (Simple Mail Transfer Protocol)

SMTP is the standard protocol used to send emails over the internet. It handles the process of sending and delivering messages between mail servers, ensuring your email reaches the recipient’s inbox. When you configure an SMTP service, you're setting up a way for your application to send emails (e.g., verification or password reset emails) securely and reliably.

Domain Name Registrar

A domain name registrar is a company that allows you to purchase and register a domain name (like yourwebsite.com). This domain becomes your unique identifier on the web and is necessary for setting up custom email addresses (e.g., contact@yourwebsite.com) and other online services. Popular domain registrars include Porkbun, GoDaddy, and Namecheap.

Domain

A domain is your website’s unique address on the internet (e.g., yourwebsite.com). It allows users to find your site without needing to know the exact IP address. Domains are essential for hosting websites and setting up custom email addresses (e.g., contact@yourwebsite.com).

Supabase

Supabase is an open-source backend as a service (BaaS) that helps developers build applications quickly by providing features like authentication, databases, real-time APIs, and storage. It is often seen as an alternative to Firebase but with a focus on using SQL databases.

AWS SES (Amazon Simple Email Service)

AWS SES is a scalable, cloud-based email service provided by Amazon Web Services. It’s commonly used to send transactional and marketing emails. It offers a reliable and affordable way to send, receive, and manage emails in large volumes.

Porkbun

Porkbun is a domain name registrar that allows you to purchase and manage domain names. It provides services like domain registration, DNS management, and hosted email, making it easy to set up and manage custom domains for websites and email.

Comments

No comments yet.