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

# Configuring Your Client

> SMTP settings for common frameworks, applications, and mail servers

Every client needs the same four values. Set them once and existing mail code sends through MailBreeze unchanged.

```
Host:     smtp.mailbreeze.com
Port:     587
Username: apikey
Password: sk_live_xxx
Security: STARTTLS
```

## Verifying your setup

Before wiring an application, confirm the credentials work by sending yourself a message:

```bash theme={null}
swaks --server smtp.mailbreeze.com:587 --tls \
  --auth-user apikey --auth-password sk_live_xxx \
  --from you@yourdomain.com --to you@yourdomain.com \
  --header "Subject: MailBreeze SMTP check"
```

A working configuration ends with:

```
<~  235 Authentication successful
<~  250 Accepted 3f2a1b8c-...
```

## Frameworks and applications

<CodeGroup>
  ```ini WordPress (WP Mail SMTP) theme={null}
  Mailer:      Other SMTP
  SMTP Host:   smtp.mailbreeze.com
  Encryption:  TLS
  SMTP Port:   587
  Auto TLS:    On
  Authentication: On
  SMTP Username:  apikey
  SMTP Password:  sk_live_xxx
  ```

  ```bash Laravel (.env) theme={null}
  MAIL_MAILER=smtp
  MAIL_HOST=smtp.mailbreeze.com
  MAIL_PORT=587
  MAIL_USERNAME=apikey
  MAIL_PASSWORD=sk_live_xxx
  MAIL_ENCRYPTION=tls
  MAIL_FROM_ADDRESS=you@yourdomain.com
  ```

  ```ruby Rails theme={null}
  config.action_mailer.delivery_method = :smtp
  config.action_mailer.smtp_settings = {
    address:              "smtp.mailbreeze.com",
    port:                 587,
    user_name:            "apikey",
    password:             ENV["MAILBREEZE_API_KEY"],
    authentication:       :plain,
    enable_starttls_auto: true
  }
  ```

  ```python Django (settings.py) theme={null}
  EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
  EMAIL_HOST = "smtp.mailbreeze.com"
  EMAIL_PORT = 587
  EMAIL_HOST_USER = "apikey"
  EMAIL_HOST_PASSWORD = os.environ["MAILBREEZE_API_KEY"]
  EMAIL_USE_TLS = True
  DEFAULT_FROM_EMAIL = "you@yourdomain.com"
  ```

  ```javascript Nodemailer theme={null}
  const transporter = nodemailer.createTransport({
    host: "smtp.mailbreeze.com",
    port: 587,
    secure: false, // upgrades via STARTTLS
    auth: {
      user: "apikey",
      pass: process.env.MAILBREEZE_API_KEY,
    },
  });
  ```

  ```php PHPMailer theme={null}
  $mail->isSMTP();
  $mail->Host       = 'smtp.mailbreeze.com';
  $mail->SMTPAuth   = true;
  $mail->Username   = 'apikey';
  $mail->Password   = getenv('MAILBREEZE_API_KEY');
  $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
  $mail->Port       = 587;
  ```
</CodeGroup>

<Note>
  For WooCommerce and form plugins, the [MailBreeze WordPress plugin](/integrations/wordpress) also syncs contacts and orders into MailBreeze. It is separate from SMTP and the two work together.
</Note>

## Postfix relay

To route an entire server's outbound mail through MailBreeze, add to `/etc/postfix/main.cf`:

```
relayhost = [smtp.mailbreeze.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_security_level = encrypt
```

Create `/etc/postfix/sasl_passwd`:

```
[smtp.mailbreeze.com]:587 apikey:sk_live_xxx
```

Then secure and load it:

```bash theme={null}
sudo chmod 600 /etc/postfix/sasl_passwd
sudo postmap /etc/postfix/sasl_passwd
sudo systemctl reload postfix
```

<Warning>
  `sasl_passwd` holds your API key in plain text. Restrict it to root and remember it exists when rotating keys — a revoked key causes Postfix to defer mail quietly rather than raise a visible error.
</Warning>

## Choosing a port

<CardGroup cols={3}>
  <Card title="587" icon="star">
    The standard submission port. Use this unless it is blocked.
  </Card>

  <Card title="465" icon="lock">
    Implicit TLS. For clients that expect TLS from the first byte.
  </Card>

  <Card title="2525" icon="arrow-right-arrow-left">
    Fallback for networks and hosts that block 587.
  </Card>
</CardGroup>

Port 25 is not offered for submission.

## Migrating from another provider

Change the host, username, and password. Everything else in your existing configuration stays as it is. If you are moving from a provider whose SMTP host you reached on port 2525, MailBreeze accepts 2525 too, so the port does not need to change either.

Your sending domain must be [verified with MailBreeze](/dns/setup) first — DNS records from your previous provider do not carry over.
