Configure the Supabase email service
In application development, a reliable email notification system is crucial for core functions such as user registration, password reset, and email confirmation.AnalyticDB for PostgreSQL is deeply integrated with the Supabase Auth authentication system and provides enterprise-level email service capabilities. Developers can use the default Alibaba Cloud email service to quickly launch applications, or connect a custom SMTP server to implement the email service.
Prerequisites
-
You have created a Supabase project. Your AnalyticDB for PostgreSQL project must have been created after the following dates:
-
China region: September 4, 2025.
-
Asia Pacific SE 1 (Singapore): August 29, 2025.
NoteThe supported regions are listed in the console. To confirm support for your project's region, log in to the Supabase Dashboard. If the Authentication > Sign In/Providers menu is visible in the sidebar, your region is supported.
-
-
You have enabled public access for your AnalyticDB for PostgreSQL project.
Configure the SMTP server
We recommend using a custom SMTP server in a production environment. To quickly get started and test the email service, you can use the default SMTP server.
Custom SMTP server
If you use any of the following Supabase Auth features, you must configure a custom SMTP server:
-
Creating an account with an email and password.
-
Passwordless sign-in (via a Magic Link sent as a one-time password to the user's email).
-
User invitations via email.
-
Social logins with email confirmation.
Procedure
-
Log in to the Supabase Dashboard and, in the sidebar, click Authentication > Emails.
-
Toggle Enable Custom SMTP on to configure your custom SMTP server.
In the Sender details section, set Sender email to supabase@service.aliyun.com and Sender name to supabase. In the SMTP Provider Settings section, set Host to smtp.aliyun.com, Port number to 465, and Minimum interval between emails being sent to 60 seconds.
Default SMTP server
Your AnalyticDB for PostgreSQL project includes a simple, default SMTP server to help you get started quickly and test the email service. This server automatically sends invitation and confirmation emails to specified addresses.
The default SMTP server has the following limitations and is not recommended for production use:
-
Limited recipient addresses: Due to regional restrictions, some email addresses may not receive emails from the default SMTP server.
-
Strict rate limiting: The default SMTP service limits the number of emails that you can send per project, and these limits are subject to change.
-
No SLA guarantee: The default SMTP server offers no service availability guarantee. It is intended only for exploring, getting started with Supabase Auth, and building test projects.
Usage
-
Enable email confirmation.
-
Log in to the Supabase Dashboard and, in the sidebar, click Authentication > Sign In/Providers.
-
Click Email, toggle the Confirm email switch on, and save your configuration.
-
-
Sign up a new user.
Dashboard
Log in to the Supabase Dashboard and, in the sidebar, click Authentication > Users. Click Add user on the right, and then select Create new User.
API
Log in to the Supabase Dashboard, click Connect in the top-left corner of the Dashboard page, and then in the pop-up window, click App Frameworks to obtain
SUPABASE_PUBLIC_URLandANON_KEY. The following is an example call:curl -X POST 'http://<SUPABASE_PUBLIC_URL>/auth/v1/signup' \ -H 'apikey: YOUR_ANON_KEY' \ -H 'Content-Type: application/json' \ -d '{ "email": "example@email.com", "password": "testPassword" }'Supabase-js
For installation and usage instructions, see supabase-js.
const { data, error } = await supabase.auth.signUp( { email: 'example@email.com', password: 'testPassword', options: { data: { first_name: 'John', age: 27, } } } )