Send email from Laravel over SMTP

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

Need an API key?

SMTP password is a Unitpost API key with emails:send. Username is always unitpost.

  • 5,000 emails/month
  • 3 API keys
  • 5 sending domains
Get free SMTP key
  1. Set your mail environment variables

    Add the following to your .env file.

    Shell
    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.

    Shell
    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.

Search docs and guides

Search the docs and product guides.