# Mail providers

Source: https://docs.qiick.io/externa/mail-providers

Externa sends mail through Laravel’s mailer (`config/mail.php`). Pick a transport with `MAIL_MAILER`, set provider credentials, and keep a real `MAIL_FROM_*`. Logo/colors for transactional templates come from **Project settings**, not `MAIL_*`.

> **Related**
> [Environment variables](https://docs.qiick.io/externa/environment-variables) · [Project settings](https://docs.qiick.io/externa/project-settings#transactional-email-branding) · [Deployment](https://docs.qiick.io/externa/deployment) · [Operations](https://docs.qiick.io/externa/operations) (queue mail)

## Defaults

Local / CI often use:

```env
MAIL_MAILER=log
MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"
```

`log` writes messages to the Laravel log — fine for smoke tests, **not** production.

For production, prefer a real provider and **queue** mail so admin requests do not wait on SMTP (`QUEUE_CONNECTION` + worker / Horizon).

## SMTP (generic)

Any SMTP relay (workspace Google/Microsoft, Mailtrap, corporate relay):

```env
MAIL_MAILER=smtp
MAIL_HOST=smtp.example.com
MAIL_PORT=587
MAIL_USERNAME=apikey_or_user
MAIL_PASSWORD=secret
MAIL_FROM_ADDRESS="noreply@example.com"
MAIL_FROM_NAME="Externa"
# Optional when the server expects a scheme:
# MAIL_SCHEME=null
```

## Amazon SES

```env
MAIL_MAILER=ses
MAIL_FROM_ADDRESS="noreply@example.com"
MAIL_FROM_NAME="Externa"

AWS_ACCESS_KEY_ID=AKIA…
AWS_SECRET_ACCESS_KEY=…
AWS_DEFAULT_REGION=eu-west-1
```

Uses Laravel’s `ses` transport (`config/mail.php`). Verify the from-domain in SES and move out of sandbox for arbitrary recipients.

## Postmark

```env
MAIL_MAILER=postmark
MAIL_FROM_ADDRESS="noreply@example.com"
MAIL_FROM_NAME="Externa"

POSTMARK_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
```

Token is read by Laravel’s Postmark transport / Symfony bridge (see Laravel mail docs for your framework version).

## Mailgun

```env
MAIL_MAILER=mailgun
MAIL_FROM_ADDRESS="noreply@example.com"
MAIL_FROM_NAME="Externa"

MAILGUN_DOMAIN=mg.example.com
MAILGUN_SECRET=key-…
# MAILGUN_ENDPOINT=api.mailgun.net   # or api.eu.mailgun.net
```

## Checklist

1. Set `MAIL_FROM_ADDRESS` to a domain you control (SPF / DKIM at the provider).
2. Smoke: password reset or notification → real inbox (not only `log`).
3. Branding: Project settings → transactional email (logo URL must be publicly reachable).
4. Queue worker running if you use `ShouldQueue` notifications / mailables.
5. Failures: Horizon / `failed_jobs` — see [Operations](https://docs.qiick.io/externa/operations).

> Laravel also ships a `resend` mailer and failover arrays in `config/mail.php`. Same idea: set `MAIL_MAILER` + provider env keys from Laravel’s docs.
