How to configure Supabase to send emails from your domain
Tags: supabase, email, resend, beginners
Published: 2023-08-10 16:02:54

One of the coolest things about [Supabase](https://supabase.com) is that it has a built-in authentication system that allows you to send emails to your users.

These emails typically include:

- Confirm signup
- Invite user
- Magic link
- Reset password
- Change email address

As you get ready to move to production, you might want to consider sending emails from a custom SMTP service. Here's why.

## The challenge of sending emails via Supabase

All of the [Supabase Auth](https://supabase.com/docs/guides/auth) emails are sent from `noreply@mail.app.supabase.io`.

Although this is good enough to get started, you probably want these emails to be sent from your own domain for brand recognition.

![Supabase integration](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ejpqzqqcikd2vx9d0z5d.png)

Apart from that, you can only send up to **4 emails per hour**. That's a [recent change](https://github.com/orgs/supabase/discussions/15896) caused by an influx of spam messages.

> "The default email system we provide is only for testing purposes - it is not intended for production use. This means that the deliverability will not be great, because everyone is using it for testing and is a major reason we don't recommend using it for production." - Paul Copplestone (CEO at Supabase)

Beyond rate limits, a managed SMTP server might also help with:

- Deliverability and IP reputation management
- Compliance and anti-spam practices
- Analytics and webhooks
- Scalability

## Integrate to have full control and visibility

Supporting existing tools is one of Supabase's product principles, so they have made it easy to configure a custom SMTP server, or any other tool you need.

On top of that, we've built an integration that allows you to connect your Supabase project to Resend.

All you need to do is navigate to the [Integrations page](https://resend.com/settings/integrations) and follow the steps.

![Supabase integration Email](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wsszy0jh6jjw0v7dlluz.png)

Once you're done, you'll be able to send emails from your own domain.

This will give you full control and visibility over your email delivery.

No more _"Hey, I didn't get your email"_ from your users. Now you can see exactly what's happening with your emails - if they were sent, delivered, bounced, or marked as spam.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vhdlly4tyozzu1sl1o1b.png)

Here's a video showing the integration end-to-end:

<iframe width="672" height="378" src="https://www.youtube.com/embed/DixLmS_3HPc" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

## Configure a custom SMTP server manually

If you prefer to configure your SMTP server manually, you can do that as well.

Navigate to your Supabase project, click on **Project Settings**, then navigate to **Auth**. Over there you'll find the **SMTP Settings** section.


![Supabase - SMTP Settings](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hbi2pvh8o4hor2afby1l.png)

Once you toggle the **Enable Custom SMTP** option, you'll be able to configure your SMTP server. You can change the host, port number, username, password, sender email, and sender name.


![Supabase - SMTP Configurations](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w4nlouwudcm7g0wk9ooj.png)

You can copy-and-paste all of these values from the [Resend SMTP](https://resend.com/settings/smtp) page.

Check the [documentation](https://resend.com/docs/send-with-supabase-smtp) to learn more about integrating SMTP with Supabase.