Send Laravel mail through Sendwax over SMTP
Two lines of .env. Or use our package and skip SMTP entirely.
The values
| Host | smtp.sendwax.com |
|---|---|
| Port | 587 |
| Encryption | TLS / STARTTLS |
| Username | sendwax |
| Password | a send-only API key from API keys in the dashboard |
| From | an address you have approved under Senders |
The username is literally sendwax for everybody — the key is what
identifies your account. Use a send-only key: it can send mail and nothing else, so a key
sitting in a settings screen on shared hosting cannot read your contacts.
MAIL_MAILER=smtp
MAIL_HOST=smtp.sendwax.com
MAIL_PORT=587
MAIL_USERNAME=sendwax
MAIL_PASSWORD=esk_send_your_key
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS="you@yourdomain.com"
Step by step
- Set the variables above and run
php artisan config:clear. MAIL_FROM_ADDRESShas to be an approved sender.- Any Mailable with its own
from()also has to be an approved sender — that is the one that catches people.
The API is better, and it is the same two lines
Our Laravel package is a transport, so Mail::send() keeps working unchanged — and you get a message id per recipient, a readable error instead of a reply code, idempotency keys, and scheduling. SMTP cannot give you any of those. Use SMTP here only if something outside your app has to send too.
Checking it worked
php artisan tinker then Mail::raw('hi', fn ($m) => $m->to('you@example.com')).
What else to know
We do not relay your message byte for byte — we read it and build a new one that our DKIM signature covers, which is what makes the reporting and the unsubscribe handling work. It costs you inline image placement, threading and a few other things, all listed on the SMTP relay page. Worth two minutes before you point production at it.
If you are writing the code rather than configuring somebody else's, the API is the better door: a message id per recipient and an error you can read, instead of a three-digit reply your framework swallowed.
Other setups
- WP Mail SMTP — The most installed SMTP plugin on WordPress. Takes about two minutes.
- FluentSMTP — Free, open source, and happy to hold several connections at once.
- Post SMTP — Keeps its own email log and can alert you when a send fails.
- Easy WP SMTP — The plainest of them. Nothing to configure beyond the connection.
- Gravity SMTP — From the Gravity Forms team, and the right choice if your forms are theirs.
- WooCommerce — Order confirmations, shipping notices, password resets. The ones customers notice.
- Postfix — Everything on the box — cron, monitoring, mail(1) — goes out properly signed.
- Python — The standard library, no dependencies.
- Nodemailer — The usual way a Node app sends mail.