---
title: "Send email from Laravel over SMTP"
description: "MAIL_HOST in .env pointed at Unitpost."
url: https://www.unitpost.com/guides/smtp/laravel
section: SMTP
updated: 2026-08-28
---
# Send email from Laravel over SMTP

## Connection settings

- **Host**: smtp.unitpost.com
- **Username**: unitpost (always this literal value)
- **Password**: Your Unitpost API key (must carry emails:send)
- **Port (STARTTLS)**: 587 (or 2587 if blocked)
- **Port (implicit TLS)**: 465 (or 2465 if blocked)
- **From address**: Any address on a verified domain

## Send email from Laravel over SMTP

> MAIL_HOST in .env pointed at Unitpost.

Laravel reads SMTP settings from your `.env`. Point the mailer at Unitpost and send from a verified domain.

### 1. Set your mail environment variables

Add the following to your `.env` file.

```bash
MAIL_MAILER=smtp
MAIL_HOST=smtp.unitpost.com
MAIL_PORT=587
MAIL_USERNAME=unitpost
MAIL_PASSWORD=${UNITPOST_API_KEY}
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=you@yourdomain.com
MAIL_FROM_NAME="${APP_NAME}"
```

> MAIL_FROM_ADDRESS must be on a domain you've verified in Unitpost.

### 2. Clear the config cache

If you cache config in production, refresh it so the new values load.

```bash
php artisan config:clear
```

### 3. Send and verify

Send a mailable (e.g. `Mail::to($user)->send(new WelcomeMail())`) and confirm it in your Unitpost Activity view.

## Related

- [Send email from Django over SMTP](https://www.unitpost.com/guides/smtp/django): Django EMAIL_BACKEND pointed at Unitpost.
- [Send email with PHPMailer over SMTP](https://www.unitpost.com/guides/smtp/php): PHPMailer SMTP mode pointed at Unitpost.
- [Send email from Next.js over SMTP](https://www.unitpost.com/guides/smtp/nextjs): Nodemailer in an App Router Route Handler.
