What the Error Means (Auth Rejected)
WHMCS hands your stored SMTP username and password to the mail server; the server answers "authentication failed" and PHPMailer surfaces it as SMTP Error: Could Not Authenticate. Because the rejection comes from the mail server rather than WHMCS itself, the fix sits in one of three places: the credentials stored in the Mail tab at Configuration → System Settings → General Settings, the port-and-encryption pairing, or a server-side block between the two machines.
The three causes map to the three sections below, in the order most people hit them. If you run a hosting business on WHMCS, the same settings back every invoice and welcome email — the reseller hosting in India stack uses this exact chain.
Cause 1: Password Logins Blocked (Use an App Password)
Google and Microsoft now refuse plain password logins from third-party apps, so a WHMCS install pointed at Gmail or Workspace fails even when the password is typed correctly. The fix is an app password:
- Enable 2-Step Verification on the Google account holding the mailbox — App Passwords require it.
- Generate an App Password — Google Account → Security → App Passwords; copy the 16-character code.
- Use it in WHMCS — System Settings → General Settings → Mail: SMTP host smtp.gmail.com, port 587 with STARTTLS, username the full address, password the App Password.
- Send a test email — same screen, Send Test Email; WHMCS logs the true SMTP conversation in the Activity Log.
On cPanel servers a second credential-adjacent cause hides behind the mail settings: SMTP Restrictions reroute all SMTP traffic back to localhost. Disable it in WHM at Home → Security Center → SMTP Restrictions if your credentials are already correct.
Correct SMTP Settings Table (Gmail, Workspace, cPanel Mail)
Copy-paste values for the three senders WHMCS installs actually use:
| Sender | SMTP Host | Port | SSL Type | Username | Password |
|---|---|---|---|---|---|
| Gmail / Workspace | smtp.gmail.com | 587 | STARTTLS | Full email address | App password (not login password) |
| Google (legacy port) | smtp.gmail.com | 465 | SSL | Full email address | App password |
| cPanel mail | mail.yourdomain.com | 465 | SSL | The full mailbox address | The mailbox's own password |
Match the From address to the authenticated mailbox in every case — servers that reject mismatched senders throw a separate Data Not Accepted or sender-verify error. If invoices must come from billing@yourdomain.com, create that mailbox and authenticate as it, or point the whole setup at business email hosting built for this.
Cause 2: Wrong Port and Encryption Combo
The port and the SSL Type must agree. The accepted pairings: None with port 25 or 26, SSL with port 465, STARTTLS with port 587. When they disagree — SSL selected on 587, or STARTTLS on 465 — the failure mode changes: you get Could not connect to SMTP host instead of the authentication error, which tells you the combo is wrong before you touch the password.
Rule of thumb: if the error is Could Not Authenticate, the connection succeeded and the credentials or their encoding are at fault; if it is Could not connect, fix the port pair first.
Cause 3: Host Blocking Outbound SMTP (Port 25)
Many shared and reseller servers block port 25 outright as anti-spam policy, and some throttle it — WHMCS configured for plain port 25 fails with connection errors before authentication even begins.
The fixes, in order:
- Switch to the submission ports — 587 with STARTTLS or 465 with implicit SSL; both are the legitimate client ports and rarely blocked.
- Use an authenticated external relay — Gmail, Workspace or a transactional service sidesteps the host's port politics entirely and improves invoice deliverability (billing emails are the ones customers must receive).
- Ask the host to unblock — legitimate use gets port 25 opened on request with VPS plans where you control the mail reputation.
Firewalls add the same symptom on the server side: CSF/ConfigServer's SMTP block filter rejects outbound connections until the server's own IPs sit on its exception list.
Testing: WHMCS Email Debug and Logs
Guessing wastes hours; WHMCS shows the real SMTP conversation. From the same Mail tab, click Send Test Email to a mailbox you control, then open Configuration → System Logs and read the entry timestamped with the attempt — it carries the server's own rejection line, not just the summary error. If the log stays empty, the failure happened before WHMCS: check DNS for the SMTP host and the firewall rules from Cause 3. Repeat the test after every change so you know which fix moved the needle.
Deliverability: SPF and DKIM for Billing Emails
Authentication gets the mail out; SPF and DKIM decide whether it lands. Add an SPF record that includes the sending host and a DKIM key from the mail server, both in the sending domain's DNS. Without them, invoices and password resets that send successfully still sink into client spam folders — and for a hosting business, a missed invoice email reads as a missed payment. Re-check both records whenever you switch the SMTP relay, because the SPF include changes with the host.
Frequently Asked Questions
How do I fix the WHMCS SMTP error could not authenticate?
Work in order: verify the SMTP username and password in Configuration → System Settings → General Settings → Mail (Gmail needs an app password), match the port to the encryption type (465 SSL, 587 STARTTLS), then rule out server blocks such as cPanel SMTP Restrictions. Test with Send Test Email and read the error in Configuration → System Logs.
Why does WHMCS email fail with Gmail?
Google blocks plain password logins from apps. Enable 2-Step Verification, generate a 16-character app password, and use it as the SMTP password in WHMCS with smtp.gmail.com on port 587 with STARTTLS and the full Gmail address as the username.
What SMTP settings should WHMCS use?
For Gmail or Workspace: smtp.gmail.com, port 587 with STARTTLS, the full address as username and an app password. For cPanel-hosted mail: mail.yourdomain.com, port 465 with SSL, the mailbox's own password, and the From address set to that same mailbox.
How do I create a Gmail app password for WHMCS?
Open Google Account → Security, turn on 2-Step Verification, then open App Passwords, name the entry for WHMCS, and copy the 16-character code Google shows. Paste that code — not your login password — into the SMTP Password field in WHMCS.
Which port for WHMCS SMTP: 587 or 465?
Both work when paired correctly: 587 with STARTTLS, or 465 with SSL. The mismatch is what breaks — SSL selected on port 587, or STARTTLS on 465, usually produces 'Could not connect to SMTP host' instead of the authentication error. Avoid plain port 25, which hosts commonly block.
Why are WHMCS invoices not sending?
The same authentication fault stops every WHMCS email, invoices included. Fix the SMTP error first, then check deliverability: SPF and DKIM records for the sending domain, and a From address that matches the authenticated mailbox, so invoice mail lands in the client's inbox rather than spam.
Is WebJi® an Indian company?
Yes. WebJi® is headquartered in Jaipur, Rajasthan and has operated since 2005. Billing, support and governance all run from India.
Do you provide GST invoices?
Every purchase and renewal gets a GST invoice with our GSTIN, and hosting prices are quoted exclusive of 18% GST. Claim input credit as applicable.

