Laravel
Laravel reads SMTP settings from your `.env`. Point the mailer at Unitpost and you're done.
What are the SMTP 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 |
How do I set it up?
Set your mail environment variables
Add the following to your
.envfile.ShellMAIL_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.
Clear the config cache
If you cache config in production, refresh it so the new values load.
Shellphp artisan config:clearSend and verify
Send a mailable (e.g.
Mail::to($user)->send(new WelcomeMail())) and confirm it in your Unitpost Activity view.