Updated 2026-10-08
How to Configure SMTP in Laravel
To send Laravel mail through an SMTP relay, set MAIL_MAILER=smtp, MAIL_HOST=smtp.bulko.io, MAIL_PORT=587 and your MAIL_USERNAME and MAIL_PASSWORD in the .env file, leaving MAIL_SCHEME empty so STARTTLS is used. For port 465 set MAIL_SCHEME=smtps; the default config/mail.php already reads all of these values.
Laravel SMTP settings
| Field | Value |
|---|---|
| MAIL_MAILER | smtp |
| MAIL_HOST | smtp.bulko.io |
| MAIL_PORT | 587 (or 465, or 2525 if your host blocks the others) |
| MAIL_SCHEME | null for 587/2525 (STARTTLS), smtps for 465 |
| MAIL_USERNAME | Your SMTP username, e.g. smtp_xxxxxxxxxxxxxxxx (Dashboard -> SMTP Access) |
| MAIL_PASSWORD | Your SMTP password (in single quotes if it contains #, $ or spaces) |
| MAIL_FROM_ADDRESS | An address on a domain you control, e.g. [email protected] |
| MAIL_FROM_NAME | "${APP_NAME}" or your brand name |
Step-by-step setup
- Buy an SMTP package on the Bulko SMTP Relay page and copy the username and password from Dashboard -> SMTP Access (they are also emailed to you after payment).
- Open the
.envfile in your project root and setMAIL_MAILER=smtp,MAIL_HOST=smtp.bulko.ioandMAIL_PORT=587. - Set
MAIL_USERNAMEandMAIL_PASSWORD. Put the password in single quotes if it contains#, spaces or$: unquoted values are cut at#, and double-quoted values expand${...}. - Leave
MAIL_SCHEME=nullfor port 587 or 2525. Symfony Mailer, which Laravel uses under the hood, connects in plain SMTP and upgrades to TLS with STARTTLS automatically. Only for port 465 setMAIL_SCHEME=smtps(Laravel also picks smtps on its own when the port is 465 and the scheme is empty). - Set
MAIL_FROM_ADDRESSto an address on your own domain. For aligned SPF, DKIM and DMARC, verify the domain under Sending Domains in the Bulko dashboard (DKIM selectorbk1plus abnc.yourdomain.comCNAME). - Check
config/mail.php: the defaultsmtpmailer in Laravel 11, 12 and 13 already readsMAIL_SCHEME,MAIL_HOST,MAIL_PORT,MAIL_USERNAMEandMAIL_PASSWORD, so usually nothing needs editing. - Run
php artisan config:clearso cached config does not override your new .env values, and restart queue workers (php artisan queue:restart) if you send mail from queued jobs.
MAIL_SCHEME vs MAIL_ENCRYPTION
Projects created before the Laravel 11 skeleton change often still have MAIL_ENCRYPTION=tls and an encryption key in config/mail.php. Current Laravel versions build the transport from scheme and port only, so MAIL_ENCRYPTION has no effect there. The only valid values for MAIL_SCHEME are smtp and smtps; values like tls or ssl make Symfony throw an unsupported scheme error. See the SMTP ports guide for the difference between 587, 465 and 2525.
.env and config/mail.php
# .env (Laravel 11, 12 and 13)
MAIL_MAILER=smtp
MAIL_SCHEME=null
MAIL_HOST=smtp.bulko.io
MAIL_PORT=587
MAIL_USERNAME=smtp_xxxxxxxxxxxxxxxx
MAIL_PASSWORD='your-smtp-password'
MAIL_FROM_ADDRESS="[email protected]"
MAIL_FROM_NAME="${APP_NAME}"
# Port 465 (implicit TLS) instead of 587:
# MAIL_PORT=465
# MAIL_SCHEME=smtps
# Hosting blocks 587 and 465? Use 2525 (STARTTLS):
# MAIL_PORT=2525
# config/mail.php (default skeleton, no changes needed):
# 'smtp' => [
# 'transport' => 'smtp',
# 'scheme' => env('MAIL_SCHEME'),
# 'url' => env('MAIL_URL'),
# 'host' => env('MAIL_HOST', '127.0.0.1'),
# 'port' => env('MAIL_PORT', 2525),
# 'username' => env('MAIL_USERNAME'),
# 'password' => env('MAIL_PASSWORD'),
# 'timeout' => null,
# 'local_domain' => env('MAIL_EHLO_DOMAIN', parse_url((string) env('APP_URL', 'http://localhost'), PHP_URL_HOST)),
# ],
# Test from the terminal:
# php artisan config:clear
# php artisan tinker
# > Mail::raw('Bulko SMTP test from Laravel', fn ($m) => $m->to('[email protected]')->subject('Laravel SMTP test'));
Send a test email
Open php artisan tinker and run Mail::raw('Bulko SMTP test from Laravel', fn ($m) => $m->to('[email protected]')->subject('Laravel SMTP test')); with a real inbox you can check. If tinker returns a SentMessage object without an exception, the relay accepted the message; it should arrive within a minute or two.
If Laravel throws a TransportException, the message text contains the SMTP reply code (for example 535 or 554 5.7.1), which tells you which row of the troubleshooting table below applies. Also check storage/logs/laravel.log if you send from a controller or a queued job instead of tinker.
Troubleshooting
| Problem | Fix |
|---|---|
| Expected response code "235" but got code "535" | The username or password is wrong. Copy both again from Dashboard -> SMTP Access, put the password in single quotes in .env, run php artisan config:clear. More on the error: https://bulko.io/en/smtp-errors/535/ |
| The "tls" scheme is not supported | MAIL_SCHEME only accepts smtp or smtps. Set MAIL_SCHEME=null (or smtp) for port 587 and smtps for 465. |
| Connection timed out or "Connection could not be established" | Your server or hosting provider blocks outbound 587 or 465. Switch to MAIL_PORT=2525 with MAIL_SCHEME=null. |
| SSL routines: wrong version number | Scheme and port do not match: smtps was used on 587 or plain smtp on 465. Use 587 with an empty scheme, or 465 with smtps. |
| Mail still goes to the log or the old server | Config is cached or MAIL_MAILER is still log. Set MAIL_MAILER=smtp, run php artisan config:clear and restart queue workers. |
| 554 5.7.1 rejected | The AI content filter flagged the message (phishing, malware, impersonation or scam patterns). Review the content and links; see https://bulko.io/en/acceptable-use/ |
FAQ
Should I use port 587 or 465 in Laravel?
Use 587 with MAIL_SCHEME empty, which gives STARTTLS. Use 465 only with MAIL_SCHEME=smtps. Port 2525 works like 587 and helps when your host blocks the standard ports.
Do I still need MAIL_ENCRYPTION in Laravel 11 or 12?
No. The current config/mail.php uses MAIL_SCHEME, and the framework ignores MAIL_ENCRYPTION when it builds the SMTP transport. You can delete it from .env.
Can Laravel read incoming mail through this relay?
No. Bulko SMTP is outgoing only and has no IMAP or inbox. Replies go to the From or Reply-To mailbox you set in Laravel.
How many emails can my Laravel app send per day?
The default limit is 2,000 emails per day per SMTP account. Write to [email protected] to raise it.
How much does it cost?
Packages are one-time payments: $5 for 5,000 emails, $15 for 20,000, $30 for 50,000 or $60 for 150,000. Unused emails never expire; there is no free SMTP trial.
Does it work with queued mail and notifications?
Yes. Queued mailables and mail notifications use the same smtp mailer, so they go through the relay once the .env is set. Restart your queue workers after changing it.
Get SMTP credentials for Laravel
One-time payment by card or crypto, no subscription. Unused emails never expire. 2,000 emails per day per SMTP account.
What you can send: Acceptable Use Policy.