> ## Documentation Index
> Fetch the complete documentation index at: https://docs.autosend.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to send emails from Supabase with SMTP

> Configure Supabase Auth to send authentication emails through AutoSend SMTP.

export const APP_PATHS = {
  home: '/',
  quickstart: '/quickstart',
  domainConfiguration: '/domain',
  apiReference: '/api-reference',
  sendEmail: '/api-reference/mails/send',
  bulkSendEmail: '/api-reference/mails/bulk',
  upsertContactApiRef: '/api-reference/contacts/upsert-contact',
  transactional: '/transactional-emails',
  emailActivity: '/transactional-emails/email-activity',
  emailTemplates: '/transactional-emails/email-templates',
  sendingEmail: '/quickstart/email-using-api',
  transactionalTroubleshooting: '/transactional-emails/troubleshooting',
  marketing: '/marketing-emails',
  campaigns: '/marketing-emails/campaigns',
  contacts: '/marketing-emails/contacts',
  contactsIntroduction: '/marketing-emails/contacts/introduction',
  contactsImportCsv: '/marketing-emails/contacts/import-csv',
  contactsLists: '/marketing-emails/contacts/lists',
  contactsSegments: '/marketing-emails/contacts/segments',
  contactsCustomFields: '/marketing-emails/contacts/contact-properties',
  contactsContactProperties: '/marketing-emails/contacts/contact-properties',
  createContactPropertyApiRef: '/api-reference/contact-properties/create',
  listContactPropertiesApiRef: '/api-reference/contact-properties/list',
  getContactPropertyApiRef: '/api-reference/contact-properties/get-by-name',
  deleteContactPropertyApiRef: '/api-reference/contact-properties/delete',
  sender: '/marketing-emails/sender',
  unsubscribeGroups: '/others/unsubscribe-groups',
  webhookIntroduction: '/others/webhooks/introduction',
  webhookEventType: '/others/webhooks/event-type',
  webhookRetries: '/others/webhooks/retries',
  webhookVerifyRequests: '/others/webhooks/verify-requests',
  dynamicTemplates: '/dynamic-templates',
  guides: '/guides',
  sitemap: '/sitemap.xml',
  team: '/others/team',
  automations: '/automations',
  events: '/automations/events',
  sendEventApi: '/api-reference/events/send-event',
  smtpIntroduction: '/quickstart/smtp',
  betterAuth: '/guides/better-auth',
  convexGuide: '/guides/convex',
  templateVariables: '/transactional-emails/variables',
  suppressions: '/others/suppressions',
  rateLimit: '/api-reference/rate-limit',
  nodejsSdk: '/sdk/nodejs',
  smtpIntegrationGuides: '/guides/smtp',
  apiKeys: '/api-keys',
  encryptedPayloads: '/others/encrypted-payloads',
  apiReferenceIntroduction: '/api-reference/introduction',
  lovableGuide: '/ai/integrations/lovable',
  aiIntroduction: '/ai/introduction',
  aiSkills: '/ai/skills',
  aiMcpServer: '/ai/mcp-server',
  aiLovable: '/ai/integrations/lovable',
  aiBolt: '/ai/integrations/bolt',
  aiV0: '/ai/integrations/v0',
  aiReplit: '/ai/integrations/replit',
  mcpClaude: '/ai/mcp-clients/claude',
  mcpCursor: '/ai/mcp-clients/cursor',
  mcpCopilot: '/ai/mcp-clients/copilot',
  mcpWindsurf: '/ai/mcp-clients/windsurf',
  mcpCodex: '/ai/mcp-clients/codex',
  mcpAntigravity: '/ai/mcp-clients/antigravity',
  mcpChatgpt: '/ai/mcp-clients/chatgpt',
  mcpRaycast: '/ai/mcp-clients/raycast',
  domainWarmup: '/marketing-emails/domain-warmup',
  projects: '/projects',
  createAutomationApi: '/api-reference/automations/create-automation',
  migrationSendgrid: '/migration/sendgrid',
  migrationResend: '/migration/resend',
  auth0CustomAction: '/guides/auth0-custom-action',
  accountBilling: '/others/account/billing',
  accountUsage: '/others/account/usage',
  inboundIntroduction: '/inbound/introduction',
  listInboundMessagesApi: '/api-reference/inbound-emails/list-messages',
  getInboundMessageApi: '/api-reference/inbound-emails/get-message',
  downloadInboundAttachmentApi: '/api-reference/inbound-emails/download-attachment',
  replyToInboundMessageApi: '/api-reference/inbound-emails/reply-to-message',
  wikiDailySendingLimit: '/wiki/daily-sending-limit'
};

export const AUTOSEND_PATHS = {
  dashboard: 'https://autosend.com/dashboard',
  apiKey: 'https://autosend.com/account/api-key',
  faqs: 'https://autosend.com/faq',
  marketingEmails: 'https://autosend.com/marketing-emails',
  webhooks: 'https://autosend.com/webhooks',
  composeByAutoSend: 'https://autosend.com/compose',
  emailActivity: 'https://autosend.com/email-activities',
  team: 'https://autosend.com/settings/team',
  pricing: 'https://autosend.com/pricing',
  verifyEmail: 'https://autosend.com/compose/email-builder?template=verify-email',
  welcomeEmail: 'https://autosend.com/compose/email-builder?template=welcome-email',
  productUpdate: 'https://autosend.com/compose/email-builder?template=product-update',
  newsletter: 'https://autosend.com/compose/email-builder?template=newsletter',
  automations: 'https://autosend.com/automations',
  globalSuppressions: 'https://autosend.com/suppressions/global',
  signup: 'https://autosend.com/signup',
  domains: 'https://autosend.com/settings/domains',
  smtpKey: 'https://autosend.com/settings/smtp',
  logoKit: 'https://asend.email/logo',
  contactsPage: 'https://autosend.com/contacts/list-and-segments',
  accountBilling: 'https://autosend.com/account/billing',
  accountUsage: 'https://autosend.com/account/usage',
  terms: 'https://autosend.com/legal/terms',
  inbound: 'https://autosend.com/email-activities/inbound'
};

<Frame>
  <img src="https://mintcdn.com/autosend-13920f5c/9RYyFcIHf2w6O1Z8/images/smtp/autosendxsupabase.jpg?fit=max&auto=format&n=9RYyFcIHf2w6O1Z8&q=85&s=23e689e694176b1ad7a2900f3a3c2474" alt="AutoSend x Supabase" width="1800" height="600" data-path="images/smtp/autosendxsupabase.jpg" />
</Frame>

Supabase uses email for authentication flows like sign-up confirmations, password resets, and magic links. By default, Supabase uses its built-in email provider, but it has rate limit. For production apps, you can configure it to use AutoSend SMTP for better deliverability.

## Prerequisites

<CardGroup cols={2}>
  <Card title="Verified Domain" href="https://autosend.com/settings/domains">
    Make sure you have a verified domain added in AutoSend to send emails from.
  </Card>

  <Card title="SMTP Key" href={AUTOSEND_PATHS.smtpKey}>
    Create a project-specific SMTP key from the SMTP tab in Project Settings.
  </Card>
</CardGroup>

## Configuration

<Steps>
  <Step title="Open Supabase Auth Settings" titleSize="h3">
    1. Go to your [Supabase dashboard](https://supabase.com/dashboard)
    2. Select your project
    3. Navigate to **Authentication**
    4. Under Notifications, you will see **Email** Section.
    5. Go to **SMTP Settings** tab.

    <Frame>
      <img src="https://mintcdn.com/autosend-13920f5c/UMDgilQN4ALpoIo1/images/smtp/supabase-step-1.png?fit=max&auto=format&n=UMDgilQN4ALpoIo1&q=85&s=d0c5de2ac71de53bf12110f1f20452fc" alt="Supabase Step 1" width="2526" height="1438" data-path="images/smtp/supabase-step-1.png" />
    </Frame>
  </Step>

  <Step title="Enable Custom SMTP" titleSize="h3">
    Toggle **Enable Custom SMTP** to enable the SMTP configuration form.

    <Frame>
      <img src="https://mintcdn.com/autosend-13920f5c/UMDgilQN4ALpoIo1/images/smtp/supabase-step-2.png?fit=max&auto=format&n=UMDgilQN4ALpoIo1&q=85&s=aced0c0090e65e4098bb9df23adb47c7" alt="Supabase Step 2" width="2526" height="1484" data-path="images/smtp/supabase-step-2.png" />
    </Frame>
  </Step>

  <Step title="Enter SMTP Credentials" titleSize="h3">
    Fill in the following settings:

    | Field            | Value                                                      |
    | ---------------- | ---------------------------------------------------------- |
    | **Sender email** | `noreply@yourdomain.com` (must match your verified domain) |
    | **Sender name**  | Your app name (e.g., "MyApp")                              |
    | **Host**         | `smtp.autosend.com`                                        |
    | **Port number**  | `587`                                                      |
    | **Username**     | autosend                                                   |
    | **Password**     | Your AutoSend SMTP key (AS\_xxx)                           |

    <Note>
      The SMTP password is no longer your API key. Create a project-specific SMTP key from the SMTP tab in <a href={AUTOSEND_PATHS.smtpKey} target="_blank" rel="noopener noreferrer">Project Settings</a>.
    </Note>

    <Frame>
      <img src="https://mintcdn.com/autosend-13920f5c/UMDgilQN4ALpoIo1/images/smtp/supabase-step-3.png?fit=max&auto=format&n=UMDgilQN4ALpoIo1&q=85&s=4bb36e54a687060795ab34bd91eb5642" alt="Supabase Step 3" width="2526" height="2622" data-path="images/smtp/supabase-step-3.png" />
    </Frame>
  </Step>

  <Step title="Save Settings" titleSize="h3">
    Click **Save** to apply your SMTP configuration.
  </Step>

  <Step title="Test the Configuration" titleSize="h3">
    Send a test email to verify your configuration:

    1. Go to **Authentication** → **Users**
    2. Click **Invite user**
    3. Enter a test email address
    4. Click **Invite**

    Check the recipient's inbox to confirm the email was delivered through AutoSend.
  </Step>
</Steps>

## Email Templates

Supabase allows you to customize the email templates used for authentication. You can modify these in **Authentication** → **Email Templates**.

Available templates:

* **Confirm signup** - Sent when a user signs up
* **Invite user** - Sent when inviting a user to your project
* **Magic link** - Sent for passwordless login
* **Change email address** - Sent when a user requests an email change
* **Reset password** - Sent for password recovery

<Note>
  Supabase email templates use Go templating syntax. Variables like `{{ .ConfirmationURL }}` are replaced with actual values when the email is sent.
</Note>

### Example Custom Template

Here's an example of a customized signup confirmation template:

```html theme={null}
<h2>Welcome to MyApp!</h2>

<p>Thanks for signing up. Please confirm your email address by clicking the button below:</p>

<a
	href="{{ .ConfirmationURL }}"
	style="display: inline-block; padding: 12px 24px; background-color: #4F39F6; color: white; text-decoration: none; border-radius: 6px;">
	Confirm Email
</a>

<p>If you didn't create an account, you can safely ignore this email.</p>

<p>Thanks,<br />The MyApp Team</p>
```

## Rate Limits

Supabase applies rate limits to authentication emails to prevent abuse. These limits are:

* **30 emails per hour** per user
* **4 emails per hour** for the same action (e.g., password reset)

AutoSend's rate limits are separate and typically higher. Check your <a href={AUTOSEND_PATHS.pricing} target="_blank" rel="noopener noreferrer">plan limits</a> for details.

## Troubleshooting

<AccordionGroup>
  <Accordion title="Emails not being sent">
    * Verify your SMTP credentials are correct - Check that your sender email domain is verified in
      AutoSend - Ensure the sender email matches a verified domain - Check Supabase logs for SMTP
      connection errors
  </Accordion>

  <Accordion title="Emails going to spam">
    * Ensure your domain has proper DNS records (SPF, DKIM, DMARC) - Use a professional sender name,
      not "noreply" - Avoid spam trigger words in your email templates - Check your domain reputation
      in AutoSend
  </Accordion>

  <Accordion title="Connection refused">
    * Supabase may have firewall restrictions on certain IP ranges - Try using port 465 instead of
      587 - Contact Supabase support if the issue persists
  </Accordion>

  <Accordion title="Authentication failed">
    * Double-check your SMTP key is correct - Ensure the username is `autosend` and the password is your
      SMTP key - Verify your SMTP key is active in the <a href={AUTOSEND_PATHS.smtpKey} target="_blank" rel="noopener noreferrer">SMTP Settings</a>
  </Accordion>
</AccordionGroup>

## Alternative: Supabase Edge Functions

For more advanced use cases, you can use Supabase Edge Functions with the AutoSend API instead of SMTP. This gives you access to features like:

* Email templates with dynamic variables
* Detailed delivery tracking
* Webhook notifications

<Card title="Edge Functions Integration" icon="https://mintcdn.com/autosend-13920f5c/IB9RbH2dcUQdl5k-/icons/automation.svg?fit=max&auto=format&n=IB9RbH2dcUQdl5k-&q=85&s=ab0d7dafbc01f3e8e4e9437823f0d76f" href="/guides/supabase-edge-functions" horizontal width="24" height="24" data-path="icons/automation.svg">
  Learn how to send emails from Supabase Edge Functions using the AutoSend API
</Card>
