Laravel

Laravel reads SMTP settings from your `.env`. Point the mailer at Unitpost and you're done.

What are the SMTP settings?

Hostsmtp.unitpost.com
Usernameunitpost(always this literal value)
PasswordYour Unitpost API key(must carry emails:send)
Port (STARTTLS)587(or 2587 if blocked)
Port (implicit TLS)465(or 2465 if blocked)
From addressAny address on a verified domain

How do I set it up?

  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.