Integration guide · SMTP
Send Laravel email with Buzzmark.
Laravel’s built-in smtp mailer is all you
need. Set a handful of MAIL_* values and every
mailable and notification in your app goes out through Buzzmark. No package to install and no
code to change.
What you need
- A Laravel app. The values below suit Laravel 11 and later; there is a note for older versions.
- A Buzzmark account. The free plan covers 300 emails a month.
- Access to the DNS of the domain you want to send from.
1. Verify your sending domain
In the Buzzmark dashboard, open Domains, add your domain and publish the SPF, DKIM, DMARC and Return-Path records it generates. Buzzmark only accepts mail whose From address is on a verified domain. Check your records at any time with the SPF, DKIM and DMARC checker.
2. Create a hive and copy its token
A hive is a mail stream with its own token and message log. Create one per app or per
environment and copy the token. It starts with bzm_srv_ and is shown once.
3. Set the mail variables
Put these in your production .env, or in your host’s environment settings:
MAIL_MAILER=smtp
MAIL_HOST=smtp.buzzmarkapp.com
MAIL_PORT=587
MAIL_USERNAME=bzm_srv_...
MAIL_PASSWORD=bzm_srv_...
MAIL_FROM_ADDRESS="hello@acme.com"
MAIL_FROM_NAME="${APP_NAME}"
- The token is both
MAIL_USERNAMEandMAIL_PASSWORD. -
Leave
MAIL_SCHEMEunset ornull. On port 587 Laravel connects in plain text and upgrades with STARTTLS, which is what Buzzmark expects. Do not set it tosmtps. - On Laravel 10 and earlier, add
MAIL_ENCRYPTION=tlsinstead. MAIL_FROM_ADDRESSmust be on your verified domain.
If you cache configuration, run php artisan config:cache again, and restart
your queue workers so they pick up the new values.
4. Test it
Send a one-off message from Tinker:
php artisan tinker
> Mail::raw('It works.', fn ($m) => $m->to('you@example.com')->subject('Hello from Buzzmark'));
The email should arrive within a few seconds and appear in the hive’s message log in
Buzzmark. If your mailables are queued, also run one through the queue and check
php artisan queue:failed for errors.
For staging and local development, use the token of a capture hive. Everything sent with it is caught in a test inbox and never delivered, so seeded users and test orders cannot email real people. Only the token differs between environments.
The SMTP reference lists every setting, the size limit and what each reply code means.
Troubleshooting
I changed .env but Laravel still uses the old mail settings. Why?
The configuration is cached. Run php artisan config:clear, or php artisan config:cache as part of your deploy. Queue workers also keep the old settings in memory, so run php artisan queue:restart.
What does "550 5.7.1" mean?
Buzzmark refused the message and the text after the code gives the reason. Most often MAIL_FROM_ADDRESS, or a from() set on one mailable, is on a domain that is not verified in Buzzmark.
Why does the connection fail or time out?
Check MAIL_PORT is 587 or 2525 and that MAIL_SCHEME is not smtps. Buzzmark upgrades a plain connection with STARTTLS and has no implicit-TLS port 465. Some hosts also block outgoing port 587, in which case 2525 usually works.
Why does authentication fail with "535"?
The token is wrong or has been rotated. Check for a trailing space or a quote character copied into .env, and that MAIL_USERNAME and MAIL_PASSWORD hold the same token.
Setting up something else? See all integration guides.
Rather not do DNS by hand?
Buzzmark is EU-hosted transactional email that generates your SPF, DKIM, DMARC and Return-Path records, checks them for you and warns you if they ever drift.
Free up to 300 emails a month · No credit card