All Products
Search
Document Center

AnalyticDB:Configure and use the email service based on Supabase

Last Updated:Oct 22, 2025

In application development, a reliable email notification system is crucial for core features such as user registration, password resets, and email confirmations. AnalyticDB for PostgreSQL is deeply integrated with the Supabase Auth system, providing enterprise-level email service capabilities. Developers can use the default Alibaba Cloud email service to quickly launch applications or connect to a custom SMTP server to manage email services.

Prerequisites

  • You have created a Supabase project. For more information, see Create a Supabase project. You must have an active AnalyticDB for PostgreSQL Supabase project that was created after one of the following dates:

    • China regions: September 4, 2025.

    • Singapore: August 29, 2025.

    Note

    The supported regions are listed in the console. Log on to the Supabase Dashboard. In the navigation pane on the left, check if the Authentication > Sign In/Providers menu option is available. If the option is available, your project's region is supported.

  • You have enabled public network access for your AnalyticDB for PostgreSQL Supabase project.

Configure the SMTP server

Important

Use a custom SMTP server in a production environment. To get started quickly and test the email service, you can use the default SMTP server.

Custom SMTP server

If you use the Supabase Auth service and require any of the following features, you must set up a custom SMTP server to send emails to users:

  • Create accounts with an email and password.

  • Passwordless accounts (Magic Link sent to an email address).

  • User invitations through email.

  • Social logins with email confirmation.

Configuration

  1. Log in to the Supabase Dashboard. In the sidebar, click Authentication > Emails.

  2. Turn on the Enable Custom SMTP option to configure your custom SMTP server.

image

Default SMTP server

AnalyticDB for PostgreSQL Supabase provides a simple default SMTP server. This server automatically sends invitation and confirmation emails to specified email addresses. It is designed to help you get started quickly and test the email service.

The default SMTP server has the following limitations and is not suitable for production environments:

  • Limited recipient addresses: Because of regional factors, some email addresses may not receive emails from the default SMTP server.

  • Strict rate limits: The default SMTP service limits the number of emails that can be sent per project. This limit may change at any time.

  • No SLA guarantee: The default SMTP service does not include a Service-Level Agreement (SLA). It is suitable only for exploring Supabase Auth and building test projects.

Usage

  1. Enable email confirmation.

    1. Log in to the Supabase Dashboard. In the sidebar, click Authentication > Sign In/Providers.

    2. Click Email, enable the Confirm email switch, and save the configuration.

      image.png

  2. Register a new user.

    Register a new user through the Supabase Dashboard

    Log on to the Supabase Dashboard. In the sidebar, click Authentication > Users. On the right, click Add user and select Create new User.

    image

    Register a new user by calling the registration API

    Log on to the Supabase Dashboard. In the upper-left corner of the dashboard, click Connect. In the pop-up window, click App Frameworks to obtain the SUPABASE_PUBLIC_URL and ANON_KEY. The following example shows how to make this 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"
      }'

    Register a new user using supabase-js

    For more information about how to install and use supabase-js, see supabase-js.

    const { data, error } = await supabase.auth.signUp(
      {
        email: 'example@email.com',
        password: 'testPassword',
        options: {
          data: {
            first_name: 'John',
            age: 27,
          }
        }
      }
    )