Invoices, password resets and welcome emails are useless if they land in spam. By default WHMCS can use PHP Mail, which sends without authentication and is often filtered. Switching to authenticated SMTP from a real mailbox on your domain fixes most delivery problems.
Before you start
- A mailbox on your domain to send from, for example
billing@example.com, created in cPanel or your mail provider. - Its SMTP server, port, user name and password (or a Google Workspace / Microsoft 365 account for OAuth).
- SPF and DKIM set up for the domain, for example via email authentication in cPanel.
Open the mail settings
- Go to Configuration → System Settings → General Settings.
- Open the Mail tab.
- Click Configure Mail Provider.
Option A: SMTP
- Choose SMTP as the Mail Provider.
- Enter the settings:
- Hostname – for cPanel hosting usually
mail.example.comor the server hostname. - Port –
465with SSL, or587with TLS. - Username – the full email address.
- Password – the mailbox password.
- SMTP Debug – leave off unless troubleshooting.
- Hostname – for cPanel hosting usually
- Click Test Configuration. WHMCS reports success or the server's error message.
- Click Save.
Option B: Google or Microsoft (OAuth)
- Choose Google or Microsoft as the provider.
- Create an OAuth app in Google Cloud Console or Microsoft Entra ID as described in the WHMCS screen, and enter the Client ID and Client Secret.
- Use the redirect URL WHMCS shows.
- Click Connect, sign in to the mailbox and approve. Then test and save.
OAuth avoids storing a mailbox password and keeps working when providers disable basic SMTP authentication.
Set the sender details
On the same Mail tab, set System Emails From Name and System Emails From Email to match the SMTP mailbox, for example Example Billing and billing@example.com. A From address on a different domain than the SMTP account causes SPF and DMARC failures.
Check sent emails
Utilities → Logs → Email Message Log lists every message WHMCS sent, with recipient and content. Failures are recorded in Utilities → Logs → Activity Log with the SMTP error.
Troubleshooting
- SMTP Error: Could not authenticate: wrong user name or password, or the mailbox requires an app password (Google, Microsoft with MFA).
- Connection timed out: the port is blocked by the WHMCS server's firewall. Try 587 or 465; many hosts block outgoing port 25.
- Certificate errors: use the hostname that matches the mail server's SSL certificate, often the server hostname rather than
mail.example.com. - Emails accepted but land in spam: check SPF, DKIM and DMARC; send a test to Gmail and use Show original.
- Some clients receive nothing: their email address bounces. Check the mailbox you send from for bounce messages.
