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

# Send with SMTP

> Submit transactional emails to Sequenzy using SMTP

Send transactional emails into Sequenzy via SMTP instead of the REST API. This
is useful for applications that already have SMTP integration (Laravel,
WordPress, legacy systems) or prefer the standard email protocol.

<Warning>
  This page describes **SMTP submission to Sequenzy**: your application connects
  to `smtp.sequenzy.com`, then Sequenzy handles outbound delivery. Sequenzy does
  not support customer-managed outbound SMTP relays: outbound delivery remains
  Sequenzy-managed through SES or Sequenzy's MTA. You cannot configure Hostinger
  or another mailbox provider as the delivery transport for campaigns,
  sequences, or transactional sends.
</Warning>

You can still use a mailbox or alias hosted by Hostinger or another provider as
the visible From address after verifying its domain in Sequenzy, and as the
Reply-To address for manual replies. Your existing mailbox hosting can remain
unchanged.

## SMTP Credentials

Use these credentials to configure your application:

| Setting      | Value               |
| ------------ | ------------------- |
| **Host**     | `smtp.sequenzy.com` |
| **Username** | `api`               |
| **Password** | Your API key        |

<Note>
  The username can be anything—only the password (your API key) is used for authentication. We recommend `api` for clarity.
</Note>

<Note>
  SMTP requires a company API key with the `transactional:send` permission. Full-access keys and keys created with the `transactional_sender` preset both work. Personal keys and keys without that permission are rejected at login.
</Note>

## Port Options

Sequenzy supports multiple ports for different network environments:

| Port     | Security     | Description                                                |
| -------- | ------------ | ---------------------------------------------------------- |
| **587**  | STARTTLS     | **Recommended.** Starts unencrypted, upgrades to TLS.      |
| **465**  | Implicit TLS | Encrypted from connection start (legacy SMTPS).            |
| **2525** | STARTTLS     | Fallback port for firewalled networks (ISPs blocking 587). |

### Which port should I use?

* **Port 587** is the standard for email submission and works with most applications
* **Port 465** is for legacy applications that require implicit TLS (connect with SSL from the start)
* **Port 2525** is useful if your ISP or firewall blocks standard SMTP ports. It uses STARTTLS just like port 587.

## Prerequisites

Before sending via SMTP:

1. **Create an API key** in [the Sequenzy dashboard](https://www.sequenzy.com/dashboard). Go to **Settings → SMTP** to view your connection details and generate the key (it doubles as your SMTP password) in one click, or manage keys under **Settings → API Keys**
2. **Verify your domain** in [Settings → Domains](https://www.sequenzy.com/dashboard/settings/domains)
3. **Configure a sender profile** with the email address you'll send from

## Quick Start

<CodeGroup>
  ```javascript Node.js (Nodemailer) theme={null}
  import nodemailer from "nodemailer";

  const transporter = nodemailer.createTransport({
    host: "smtp.sequenzy.com",
    port: 587,
    secure: false, // true for port 465, false for 587/2525
    auth: {
      user: "api",
      pass: process.env.SEQUENZY_API_KEY,
    },
  });

  await transporter.sendMail({
    from: "you@your-verified-domain.com",
    to: "recipient@example.com",
    subject: "Hello from Sequenzy",
    html: "<h1>Hello!</h1><p>This email was sent via SMTP.</p>",
  });
  ```

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

  msg = MIMEMultipart("alternative")
  msg["Subject"] = "Hello from Sequenzy"
  msg["From"] = "you@your-verified-domain.com"
  msg["To"] = "recipient@example.com"

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

  with smtplib.SMTP("smtp.sequenzy.com", 587) as server:
      server.starttls()
      server.login("api", os.environ["SEQUENZY_API_KEY"])
      server.sendmail(msg["From"], msg["To"], msg.as_string())
  ```

  ```php PHP (PHPMailer) theme={null}
  use PHPMailer\PHPMailer\PHPMailer;

  $mail = new PHPMailer(true);

  $mail->isSMTP();
  $mail->Host = 'smtp.sequenzy.com';
  $mail->SMTPAuth = true;
  $mail->Username = 'api';
  $mail->Password = $_ENV['SEQUENZY_API_KEY'];
  $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
  $mail->Port = 587;

  $mail->setFrom('you@your-verified-domain.com', 'Your Name');
  $mail->addAddress('recipient@example.com');
  $mail->isHTML(true);
  $mail->Subject = 'Hello from Sequenzy';
  $mail->Body = '<h1>Hello!</h1><p>This email was sent via SMTP.</p>';

  $mail->send();
  ```

  ```go Go (net/smtp) theme={null}
  package main

  import (
      "net/smtp"
      "os"
  )

  func main() {
      apiKey := os.Getenv("SEQUENZY_API_KEY")
      auth := smtp.PlainAuth("", "api", apiKey, "smtp.sequenzy.com")

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

      smtp.SendMail("smtp.sequenzy.com:587", auth, "you@your-verified-domain.com", to, msg)
  }
  ```

  ```ruby Ruby (mail gem) theme={null}
  require 'mail'

  Mail.defaults do
    delivery_method :smtp, {
      address: 'smtp.sequenzy.com',
      port: 587,
      user_name: 'api',
      password: ENV['SEQUENZY_API_KEY'],
      authentication: :plain,
      enable_starttls_auto: true
    }
  end

  Mail.deliver do
    from    'you@your-verified-domain.com'
    to      'recipient@example.com'
    subject 'Hello from Sequenzy'
    html_part do
      content_type 'text/html; charset=UTF-8'
      body '<h1>Hello!</h1><p>This email was sent via SMTP.</p>'
    end
  end
  ```

  ```bash cURL (swaks) theme={null}
  # Install: brew install swaks (macOS) or apt install swaks (Ubuntu)
  swaks --to recipient@example.com \
    --from you@your-verified-domain.com \
    --server smtp.sequenzy.com \
    --port 587 --tls \
    --auth LOGIN \
    --auth-user "api" \
    --auth-password "$SEQUENZY_API_KEY" \
    --header "Subject: Hello from Sequenzy" \
    --body "This is a test email sent via SMTP"
  ```
</CodeGroup>

## Framework Integrations

### Laravel

Update your `.env` file:

```bash theme={null}
MAIL_MAILER=smtp
MAIL_HOST=smtp.sequenzy.com
MAIL_PORT=587
MAIL_USERNAME=api
MAIL_PASSWORD=ek_your_api_key
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=you@your-verified-domain.com
MAIL_FROM_NAME="Your App"
```

Then send emails using Laravel's Mail facade:

```php theme={null}
Mail::to('recipient@example.com')->send(new WelcomeEmail());
```

### Django

Update your `settings.py`:

```python theme={null}
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.sequenzy.com'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = 'api'
EMAIL_HOST_PASSWORD = os.environ.get('SEQUENZY_API_KEY')
DEFAULT_FROM_EMAIL = 'you@your-verified-domain.com'
```

Then send emails:

```python theme={null}
from django.core.mail import send_mail

send_mail(
    'Hello from Sequenzy',
    'Plain text body',
    'you@your-verified-domain.com',
    ['recipient@example.com'],
    html_message='<h1>Hello!</h1><p>This email was sent via SMTP.</p>'
)
```

### Ruby on Rails

Update `config/environments/production.rb`:

```ruby theme={null}
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
  address: 'smtp.sequenzy.com',
  port: 587,
  user_name: 'api',
  password: ENV['SEQUENZY_API_KEY'],
  authentication: :plain,
  enable_starttls_auto: true
}
```

### WordPress

Install a plugin like [WP Mail SMTP](https://wordpress.org/plugins/wp-mail-smtp/) and configure:

* **SMTP Host**: `smtp.sequenzy.com`
* **Encryption**: TLS
* **SMTP Port**: 587
* **SMTP Username**: `api`
* **SMTP Password**: Your API key

## Features

### Same Pipeline as REST API

SMTP emails go through the same processing pipeline:

* **Analytics**: All emails appear in your Sent Emails dashboard
* **Tracking**: Opens and clicks are tracked (if enabled)
* **Branding**: Footer added for free tier accounts
* **Rate limits**: Same limits apply as REST API

### Security Enforcement

The SMTP server applies the same security checks:

| Check               | Description                                    |
| ------------------- | ---------------------------------------------- |
| API key validation  | Password must be a valid API key               |
| Domain verification | Sender domain must be verified                 |
| Bounce protection   | Emails to known bounced addresses are rejected |
| Rate limiting       | 100 emails/minute per company                  |
| Account status      | Paused/suspended accounts cannot send          |

### Message Limits

| Limit             | Value |
| ----------------- | ----- |
| Max message size  | 25 MB |
| Max To recipients | 50    |

## Rate Limits

| Limit                        | Value             |
| ---------------------------- | ----------------- |
| Emails per minute            | 100 (per company) |
| Auth failures before lockout | 5 (per IP)        |
| Lockout duration             | 15 minutes        |

## Troubleshooting

<AccordionGroup>
  <Accordion title="Connection refused or timeout">
    Your ISP or firewall may be blocking SMTP ports. Try port 2525 instead of 587.
  </Accordion>

  <Accordion title="Authentication failed">
    * Ensure you're using a valid API key as the password
    * The API key should start with `ek_`
    * Check that the key hasn't been revoked in your dashboard
  </Accordion>

  <Accordion title="Domain not verified">
    The sender domain (the domain in your From address) must be verified in Settings → Domains before you can send.
  </Accordion>

  <Accordion title="Recipient rejected">
    The recipient email may be on the bounce list. Check your Sent Emails dashboard for previous bounces to this address.
  </Accordion>

  <Accordion title="Rate limit exceeded">
    You've exceeded 100 emails/minute. Wait a minute and try again, or contact support to increase your limit.
  </Accordion>
</AccordionGroup>

## FAQ

<AccordionGroup>
  <Accordion title="Can I use any username?">
    Yes, the username is ignored—only the password (your API key) is used for authentication. We recommend using `api` for clarity.
  </Accordion>

  <Accordion title="Do SMTP emails appear in my dashboard?">
    Yes, all emails sent via SMTP appear in your Sent Emails dashboard with full analytics, same as REST API emails.
  </Accordion>

  <Accordion title="Are opens and clicks tracked?">
    Yes, if tracking is enabled for your account. SMTP emails use the same tracking pixel and link rewriting as REST API emails.
  </Accordion>

  <Accordion title="Can I send attachments?">
    Yes, standard MIME attachments work. Maximum total message size is 25MB.
  </Accordion>

  <Accordion title="What's the difference between ports 587 and 465?">
    * **Port 587 (STARTTLS)**: Starts unencrypted, then upgrades to TLS. This is the modern standard.
    * **Port 465 (Implicit TLS)**: Encrypted from the start. This is a legacy method but still supported.

    Use port 587 unless your application specifically requires implicit TLS.
  </Accordion>

  <Accordion title="Why use port 2525?">
    Some ISPs and corporate firewalls block standard SMTP ports (25, 587, 465). Port 2525 is an alternative that's less likely to be blocked and still uses STARTTLS like port 587.
  </Accordion>

  <Accordion title="Can I use SMTP for bulk campaigns?">
    SMTP is designed for transactional emails. For bulk marketing campaigns, use the Campaign feature in the dashboard or REST API.
  </Accordion>
</AccordionGroup>
