Email / SMTP setup
Operator guide
Email / SMTP setup
Verification emails, password resets, notifications and backups all go through
Laravel's mail system. On a fresh install MAIL_MAILER=log — email is written
to the log instead of sent, so nothing actually arrives. Configure SMTP before
opening registration.
1. Create a mailbox
On cPanel shared hosting: Email → Email Accounts → Create a mailbox on your
domain, e.g. hello@your-node.example. Note the password.
On a VPS: use an SMTP relay or transactional provider (Postmark, Resend, Mailgun, SES) and its credentials.
2. Configure .env
MAIL_MAILER=smtp
MAIL_HOST=mail.your-node.example # or your provider's SMTP host
MAIL_PORT=465
MAIL_USERNAME=hello@your-node.example
MAIL_PASSWORD=your-mailbox-password
MAIL_FROM_ADDRESS="hello@your-node.example"
MAIL_FROM_NAME="${APP_NAME}"
Port
465= implicit TLS (SSL). Port587= STARTTLS. Pick the one your host supports; if you use 587, setMAIL_SCHEME=tls(leave unset for 465).
3. cPanel / shared-hosting specifics (verified)
The app and the mail server often share the same box. Use the server
hostname, not 127.0.0.1, for MAIL_HOST:
MAIL_HOST=server3.example-hosting.com # the server hostname — matches the SMTP TLS cert CN
MAIL_PORT=465
MAIL_USERNAME=hello@your-node.example
MAIL_PASSWORD=your-mailbox-password
Using 127.0.0.1 fails TLS certificate validation because the cert is issued
to the hostname, not the loopback address.
4. Verify
Clear config, then send a test:
php artisan config:clear
php artisan tinker
Illuminate\Support\Facades\Mail::raw('Test from VulaSocial', function ($m) {
$m->to('you@example.com')->subject('VulaSocial mail test');
});
echo 'sent';
If no exception is thrown, check the recipient's inbox.
5. Confirm the full flow
Register a throwaway account and confirm the verification email arrives and the link verifies the account. Then delete the throwaway.
Troubleshooting
| Symptom | Likely fix |
|---|---|
550 / mail server rejects |
Wrong credentials, or sending to an address the server won't accept |
| TLS CN mismatch | MAIL_HOST should be the server hostname, not 127.0.0.1 |
| Nothing arrives, no error | MAIL_MAILER still log, or port/scheme mismatch |
| SPF/DKIM warnings | Add SPF + DKIM records in DNS (cPanel auto-generates these) |
Related
Still stuck? Contact the node administrator.