Prerequisites
- A Laravel application
- Your mySMTP credentials (see Setting up SMTP credentials)
- A verified sending domain
SMTP settings
Shared IP plans are only available to customers in Denmark.
Configure Laravel SMTP
1
Update .env
Open For Laravel 11 and later, set For Laravel 10 and earlier, set:
.env in the root of your Laravel project and set the mail variables. Use the version-specific encryption setting:MAIL_SCHEME=tls instead of MAIL_ENCRYPTION:2
Clear config cache
Run the following command so Laravel picks up the new values:
3
Send a test email with Tinker
Start Tinker:Then run:Check your inbox for the message.
Troubleshooting
Connection refused or timeout
Connection refused or timeout
Make sure you are using your real mySMTP hostname (not
relayxx.mysmtp.com). Check that your server allows outbound connections on port 587. If the port is blocked, try 2525 or 465.Authentication failed
Authentication failed
Re-enter your mySMTP username and password in
.env, then run php artisan config:clear again. Verify there are no extra spaces or quotes.Emails go to spam
Emails go to spam
Verify SPF, DKIM, and DMARC are configured for your sending domain. See DNS settings quick explainer and SPF, DKIM, DMARC, and BIMI explained.
Test email does not arrive
Test email does not arrive
Check your Laravel logs (
storage/logs/laravel.log) for SMTP error details. Also confirm MAIL_FROM_ADDRESS uses a domain authenticated with mySMTP..png?fit=max&auto=format&n=-Uw4rR8wfyv_xkzc&q=85&s=898bb0b43b6c9dce61441f46ac9ac860)