Master da Web
SMTP guide

How to set up SMTP in Laravel with the .env you already have

Laravel already sends over SMTP: point the MAIL_* variables at our server, with your sending key as the password. Mailables and Notifications stay as they are, now with your domain's DKIM, per-recipient logs and webhooks.

The sandbox is free for everyone. Already run a cloud service with us? The free plan is yours too.

.env

MAIL_MAILER=smtpMAIL_HOST=YOUR_PANEL_HOSTMAIL_PORT=587MAIL_USERNAME=apikeyMAIL_PASSWORD=YOUR_SENDING_KEY# Laravel 11 reads MAIL_SCHEME; earlier versions, MAIL_ENCRYPTIONMAIL_SCHEME=smtpMAIL_ENCRYPTION=tlsMAIL_FROM_ADDRESS="orders@yourdomain.com"MAIL_FROM_NAME="${APP_NAME}"

With both security variables, the same .env works on any version: on port 587, both mean STARTTLS.

Laravel

Step by step: SMTP in Laravel

From a verified domain to the first delivered email, with the result of each send in the panel.

  1. 1

    Verify your domain

    Add the domain in the panel, under Email & SMTP, and publish the DNS records it shows.

  2. 2

    Create a sending key

    The key is the SMTP password and is shown only once. Keep it in .env, never in the repository.

  3. 3

    Fill in .env

    MAIL_HOST with the panel's host, port 587, the username apikey and the key in MAIL_PASSWORD. Then run php artisan config:clear.

  4. 4

    Send a test

    From tinker, as in the example, and see in the panel's Activity what happened to the message.

Also useful

Test from tinker

A plain email, to check the settings before your first Mailable.

Test from tinker

$ php artisan tinker> Mail::raw('Hi! SMTP is working.', fn ($m) => $m->to('you@example.com')->subject('Test'));
Beyond SMTP

What you get by sending with Master da Web

Delivery under your domain

DKIM with your domain's key, aligned SPF and DMARC: what Gmail, Yahoo and Microsoft check before they accept.

Per-recipient logs

Delivered, deferred, bounced or marked as spam, with the receiving server's full answer.

Webhooks and suppressions

Signed events in your system, and bounces and complaints taken off the list by themselves.

Free sandbox

A sandbox key captures messages so you can test without delivering anything to anyone.

What it costs

Plans from R$29.00 a month, with 10,000 emails included. If you run a cloud service with us, you start on the free plan, with 3,000 emails a month. The sandbox is free for everyone.

See plans and prices
Discover the SMTP & Email API
FAQ

Questions about SMTP in Laravel

What comes up most while setting it up.

Set up SMTP in Laravel today

Create your account, verify your domain and start testing today.