> ## 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 email with AutoSend SMTP

> Send transactional emails using AutoSend's SMTP relay service. Integrate with any application that supports 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/custom-fields',
  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',
  smtpIntroduction: '/quickstart/smtp',
  betterAuth: '/guides/better-auth',
  templateVariables: '/transactional-emails/variables',
  suppressions: '/others/suppressions',
  rateLimit: '/api-reference/rate-limit',
  nodejsSdk: '/sdk/nodejs',
  smtpIntegrationGuides: '/guides/smtp',
  apiKeys: '/api-keys',
  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'
};

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',
  logoKit: 'https://asend.email/logo',
  contactsPage: 'https://autosend.com/contacts/list-and-segments'
};

<Frame>
  <img src="https://mintcdn.com/autosend-13920f5c/5EmJhd0bGrjwsR9N/images/smtp/autosend-smtp-settings.png?fit=max&auto=format&n=5EmJhd0bGrjwsR9N&q=85&s=664ed9c1321bf5790000b395a5fefc5e" alt="Supabase Step 1" width="2530" height="1702" data-path="images/smtp/autosend-smtp-settings.png" />
</Frame>

AutoSend provides an SMTP relay service that allows you to send transactional emails using standard SMTP protocols. This is useful when integrating with platforms that require SMTP credentials, such as [Supabase](/guides/smtp/supabase), [WordPress](/guides/smtp/wordpress), or other services that don't support REST APIs.

## 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="API Key" href="https://autosend.com/settings/api-key">
    Create a new API key for SMTP authentication or use the existing one.
  </Card>
</CardGroup>

## SMTP Credentials

Use the following credentials to configure your SMTP client:

| Setting        | Value                                   |
| -------------- | --------------------------------------- |
| **Host**       | `smtp.autosend.com`                     |
| **Port**       | `465`, `587`                            |
| **Username**   | autosend                                |
| **Password**   | AS\_xxxx (Your AutoSend API key secret) |
| **Encryption** | TLS/SSL (see port guide below)          |

## Port Configuration

AutoSend supports multiple ports to accommodate different network configurations:

| Port  | Security     | Description                                                                   |
| ----- | ------------ | ----------------------------------------------------------------------------- |
| `465` | Implicit TLS | SMTPS - Connection is encrypted from the start. Recommended for most uses.    |
| `587` | STARTTLS     | Submission port - Starts unencrypted, upgrades to TLS. Most widely supported. |

<Tip>
  **Which port should I use?** Start with port `587` (STARTTLS) as it's the most widely supported.
  For implicit TLS, use port `465`.
</Tip>

## Integration Examples

<CodeGroup>
  ```javascript Node.js expandable theme={null}
  const nodemailer = require('nodemailer');

  const transporter = nodemailer.createTransport({
  	host: 'smtp.autosend.com',
  	port: 587,
  	secure: true,
  	auth: {
  		user: 'autosend',
  		pass: 'AS_xxx',
  	},
  });

  await transporter.sendMail({
  	from: 'sender@yourdomain.com',
  	to: 'recipient@example.com',
  	subject: 'Hello from AutoSend',
  	html: '<h1>Welcome!</h1><p>This email was sent via SMTP.</p>',
  });
  ```

  ```python Python expandable theme={null}
  import smtplib
  from email.mime.text import MIMEText
  from email.mime.multipart import MIMEMultipart

  smtp_host = "smtp.autosend.com"
  smtp_port = 587
  username = "sender@yourdomain.com"
  password = "as_your_api_key_here"

  msg = MIMEMultipart("alternative")
  msg["Subject"] = "Hello from AutoSend"
  msg["From"] = username
  msg["To"] = "recipient@example.com"

  html = "<h1>Welcome!</h1><p>This email was sent via SMTP.</p>"
  msg.attach(MIMEText(html, "html"))

  with smtplib.SMTP(smtp_host, smtp_port) as server:
      server.starttls()
      server.login(username, password)
      server.sendmail(username, ["recipient@example.com"], msg.as_string())
  ```

  ```php PHP expandable theme={null}
  <?php
  use PHPMailer\PHPMailer\PHPMailer;
  use PHPMailer\PHPMailer\SMTP;

  $mail = new PHPMailer(true);

  $mail->isSMTP();
  $mail->Host       = 'smtp.autosend.com';
  $mail->SMTPAuth   = true;
  $mail->Username   = 'sender@yourdomain.com';
  $mail->Password   = 'as_your_api_key_here';
  $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
  $mail->Port       = 587;

  $mail->setFrom('sender@yourdomain.com', 'Your Name');
  $mail->addAddress('recipient@example.com');

  $mail->isHTML(true);
  $mail->Subject = 'Hello from AutoSend';
  $mail->Body    = '<h1>Welcome!</h1><p>This email was sent via SMTP.</p>';

  $mail->send();
  ?>
  ```

  ```ruby Ruby expandable theme={null}
  require 'net/smtp'

  message = <<~MESSAGE
    From: sender@yourdomain.com
    To: recipient@example.com
    Subject: Hello from AutoSend
    Content-Type: text/html

    <h1>Welcome!</h1><p>This email was sent via SMTP.</p>
  MESSAGE

  Net::SMTP.start('smtp.autosend.com', 587, 'yourdomain.com',
                  'sender@yourdomain.com', 'as_your_api_key_here', :plain) do |smtp|
    smtp.send_message message, 'sender@yourdomain.com', 'recipient@example.com'
  end
  ```

  ```go Go expandable theme={null}
  package main

  import (
      "net/smtp"
  )

  func main() {
      auth := smtp.PlainAuth("", "sender@yourdomain.com", "as_your_api_key_here", "smtp.autosend.com")

      to := []string{"recipient@example.com"}
      msg := []byte("To: recipient@example.com\r\n" +
          "Subject: Hello from AutoSend\r\n" +
          "Content-Type: text/html\r\n" +
          "\r\n" +
          "<h1>Welcome!</h1><p>This email was sent via SMTP.</p>\r\n")

      err := smtp.SendMail("smtp.autosend.com:587", auth, "sender@yourdomain.com", to, msg)
      if err != nil {
          panic(err)
      }
  }
  ```
</CodeGroup>

## Platform Integrations

AutoSend SMTP works with any platform that supports SMTP configuration:

<CardGroup cols={2}>
  <Card title="Auth0" href="/guides/smtp/auth0" icon="https://mintcdn.com/autosend-13920f5c/D_Mfmxm4VT2-xi-A/images/guides/auth0.png?fit=max&auto=format&n=D_Mfmxm4VT2-xi-A&q=85&s=300319095f35ae56289f98f4552bf530" width="124" height="122" data-path="images/guides/auth0.png">
    Send authentication emails through AutoSend SMTP.
  </Card>

  <Card title="Customer.io" href="/guides/smtp/customerio" icon="https://mintcdn.com/autosend-13920f5c/D_Mfmxm4VT2-xi-A/images/guides/customerio.png?fit=max&auto=format&n=D_Mfmxm4VT2-xi-A&q=85&s=c5d1c813a47be8921a5562264eefe5a8" width="124" height="122" data-path="images/guides/customerio.png">
    Send emails from Customer.io through AutoSend SMTP.
  </Card>

  <Card title="Descope" href="/guides/smtp/descope" icon="https://mintcdn.com/autosend-13920f5c/D_Mfmxm4VT2-xi-A/images/guides/descope.png?fit=max&auto=format&n=D_Mfmxm4VT2-xi-A&q=85&s=428d8263d3d48786d9467f07796d760f" width="120" height="120" data-path="images/guides/descope.png">
    Send authentication emails from Descope through AutoSend SMTP.
  </Card>

  <Card title="Nodemailer" href="/guides/smtp/nodemailer" icon="https://mintcdn.com/autosend-13920f5c/D_Mfmxm4VT2-xi-A/images/guides/nodemailer.png?fit=max&auto=format&n=D_Mfmxm4VT2-xi-A&q=85&s=e470723fa2b90d46188eaf2464d1f10f" width="124" height="122" data-path="images/guides/nodemailer.png">
    Send emails from Node.js apps using Nodemailer with AutoSend SMTP.
  </Card>

  <Card title="Supabase" href="/guides/smtp/supabase" icon="https://mintcdn.com/autosend-13920f5c/D_Mfmxm4VT2-xi-A/images/guides/supabase.png?fit=max&auto=format&n=D_Mfmxm4VT2-xi-A&q=85&s=87f54096e8e4df246521713ef1aeed57" width="120" height="120" data-path="images/guides/supabase.png">
    Send auth emails from Supabase through AutoSend SMTP.
  </Card>

  <Card title="WordPress" href="/guides/smtp/wordpress" icon="https://mintcdn.com/autosend-13920f5c/D_Mfmxm4VT2-xi-A/images/guides/wordpress.png?fit=max&auto=format&n=D_Mfmxm4VT2-xi-A&q=85&s=6f3ae79546a60d47b05c03706a9c1c73" width="124" height="122" data-path="images/guides/wordpress.png">
    Configure WordPress to send emails through AutoSend SMTP.
  </Card>
</CardGroup>

## Testing with Swaks

[Swaks](https://www.jetmore.org/john/code/swaks/) (Swiss Army Knife for SMTP) is a powerful command-line tool for testing SMTP configurations.

### Installation

<CodeGroup>
  ```bash macOS theme={null}
  brew install swaks
  ```

  ```bash Ubuntu/Debian theme={null}
  sudo apt-get install swaks
  ```

  ```bash Windows theme={null}
  # Using Chocolatey
  choco install swaks
  ```
</CodeGroup>

### Basic Test

```bash theme={null}
swaks --to recipient@example.com \
      --from sender@yourdomain.com \
      --server smtp.autosend.com \
      --port 587 \
      --tls \
      --auth-user sender@yourdomain.com \
      --auth-password AS_xxx
      --header "Subject: Test Email via SMTP" \
      --body "This email was sent via AutoSend SMTP."
```

### Test with Implicit TLS (Port 465)

```bash theme={null}
swaks --to recipient@example.com \
      --from sender@yourdomain.com \
      --server smtp.autosend.com \
      --port 465 \
      --auth-user sender@yourdomain.com \
      --auth-password as_your_api_key_here \
      --tlsc
```

### Test with HTML Body

```bash theme={null}
swaks --to recipient@example.com \
      --from sender@yourdomain.com \
      --server smtp.autosend.com \
      --port 587 \
      --auth-user sender@yourdomain.com \
      --auth-password as_your_api_key_here \
      --header "Content-Type: text/html" \
      --body "<h1>Test Email</h1><p>This is a test from swaks.</p>"
```

Add `-v` or `-vv` for detailed SMTP conversation logs.

## Troubleshooting

<AccordionGroup>
  <Accordion title="Connection refused or timeout">
    **Possible causes:**

    * The SMTP port may be blocked by your firewall or ISP
    * Incorrect server hostname
    * Network connectivity issues

    **Solutions:**

    * Verify the hostname is `smtp.autosend.com`
    * Check your firewall rules
    * Test connectivity: `telnet smtp.autosend.com 587`
  </Accordion>

  <Accordion title="Authentication failed">
    **Possible causes:**

    * Invalid API key
    * Username doesn't match a verified sender

    **Solutions:**

    * Verify your API key in the <a href={AUTOSEND_PATHS.apiKey} target="_blank" rel="noopener noreferrer">Dashboard</a>
    * Ensure the username is a verified sender email address
    * Check that your domain is properly verified
    * Check for any extra whitespace in your credentials
  </Accordion>

  <Accordion title="TLS/SSL errors">
    **Possible causes:**

    * Using wrong encryption mode for the port
    * TLS certificate verification issues

    **Solutions:**

    * For ports `465`: Use implicit TLS (connection encrypted from start)
    * For ports `587`: Use STARTTLS (starts unencrypted, upgrades to TLS)
    * If using swaks, add `--tlsc` flag only for ports 465
  </Accordion>

  <Accordion title="Emails not delivered">
    **Possible causes:**

    * Domain not verified
    * SPF/DKIM not configured
    * Recipient server blocking

    **Solutions:**

    * Verify your sending domain is configured and verified in AutoSend
    * Check the sender email matches your verified domain
    * Add the required DNS records for SPF and DKIM
    * Review email activity in the <a href={AUTOSEND_PATHS.emailActivity} target="_blank" rel="noopener noreferrer">Email Activity</a> dashboard
  </Accordion>
</AccordionGroup>

## FAQs

<AccordionGroup>
  <Accordion title="Can I see emails sent via SMTP in my dashboard?">
    Yes! All emails sent through SMTP appear in your AutoSend Dashboard under the [**Email
    Activity**](/transactional-emails/email-activity) section. You can view delivery status, opens,
    clicks, and bounces just like API-sent emails.
  </Accordion>

  <Accordion title="What are the rate limits for SMTP?">
    SMTP rate limits are the same as the REST API. Your plan's sending limits apply across both SMTP
    and API. Check your [Dashboard](https://autosend.com/dashboard) for your current limits.
  </Accordion>

  <Accordion title="Can I send attachments via SMTP?">
    Yes, AutoSend SMTP supports standard MIME attachments. Most SMTP libraries handle attachment
    encoding automatically. The maximum message size is 25MB including attachments.
  </Accordion>

  <Accordion title="Is SMTP as fast as the API?">
    SMTP adds minimal overhead compared to the REST API. For high-volume sending or when you need
    immediate delivery confirmation, the API may be slightly faster. For most use cases, SMTP
    performance is excellent.
  </Accordion>

  <Accordion title="Do webhooks work with SMTP emails?">
    Yes! [Webhooks](/others/webhooks/introduction) are triggered for all events (delivery, bounce,
    open, click, etc.) regardless of whether the email was sent via SMTP or the API.
  </Accordion>

  <Accordion title="Can I use multiple sender addresses?">
    Yes, you can send from any email address on a verified domain. Simply use the desired sender
    address in the "From" field. But make sure the domain is verified in your AutoSend account.
  </Accordion>
</AccordionGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Verify Your Domain" icon="https://mintcdn.com/autosend-13920f5c/nx_wYfWx3qeZwg1C/icons/domain.svg?fit=max&auto=format&n=nx_wYfWx3qeZwg1C&q=85&s=9393f9f9b0f7029e6ba8acf2bc09d864" href="/domain" width="24" height="24" data-path="icons/domain.svg">
    Set up SPF, DKIM, and DMARC for better deliverability
  </Card>

  <Card title="API Integration" icon="https://mintcdn.com/autosend-13920f5c/nx_wYfWx3qeZwg1C/icons/api.svg?fit=max&auto=format&n=nx_wYfWx3qeZwg1C&q=85&s=a257e726f0f001df70664b740dcd5af6" href="/api-reference" width="24" height="24" data-path="icons/api.svg">
    Explore our REST API for more advanced use cases
  </Card>

  <Card title="Webhooks" icon="https://mintcdn.com/autosend-13920f5c/nx_wYfWx3qeZwg1C/icons/webhook.svg?fit=max&auto=format&n=nx_wYfWx3qeZwg1C&q=85&s=14ad6675c71731ac04f786559a813ee1" href="/others/webhooks/introduction" width="24" height="24" data-path="icons/webhook.svg">
    Set up webhooks to track email events in real-time
  </Card>

  <Card title="Email Activity" icon="https://mintcdn.com/autosend-13920f5c/nx_wYfWx3qeZwg1C/icons/email-activity.svg?fit=max&auto=format&n=nx_wYfWx3qeZwg1C&q=85&s=2ecad7369f217ee7d03c3d8dfdd36d22" href="/transactional-emails/email-activity" width="24" height="24" data-path="icons/email-activity.svg">
    Monitor your email delivery and engagement
  </Card>
</CardGroup>
