The "SMTP Authentication Failed" error occurs when your email client or application cannot verify its credentials with the mail server. This prevents all outgoing email from being sent and is one of the most frustrating email issues to deal with.
Whether you're seeing this in Outlook, Thunderbird, WordPress, or a custom application, the fix almost always comes down to one of a few root causes.
Quick Fix Checklist
- ✅ Double-check your username (use the full email address)
- ✅ Verify your password — re-type it, don't paste
- ✅ Confirm the correct SMTP server hostname
- ✅ Use the right port: 587 (STARTTLS) or 465 (SSL)
- ✅ Enable SMTP authentication in your email client settings
- ✅ Check if your account is locked or suspended
- ✅ Verify the server allows SMTP authentication
Why Does SMTP Authentication Fail?
1. Wrong Username or Password
The most common cause. SMTP username is usually the full email address (e.g., [email protected]), not just the username part.
2. Wrong Port or Encryption
Using the wrong port/encryption combination will cause authentication to fail:
- Port 587 — STARTTLS (recommended)
- Port 465 — SSL/TLS
- Port 25 — Unencrypted (often blocked, not recommended)
3. SMTP Authentication Disabled on Server
Some servers have SMTP authentication disabled by default, especially fresh VPS installs.
4. Firewall Blocking SMTP Ports
Server firewalls (CSF, UFW, iptables) may block outgoing connections on SMTP ports.
Step-by-Step Fix
Step 1: Verify Credentials
Login to webmail (e.g., https://yourdomain.com:2096) with the same username and password. If webmail login fails, the password is wrong.
Reset the password in cPanel:
# cPanel → Email Accounts → Manage → Change Password
Step 2: Check SMTP Settings
Use these settings in your email client:
SMTP Server: mail.yourdomain.com (or your server hostname)
Port: 587
Encryption: STARTTLS
Authentication: Required
Username: [email protected]
Password: your-email-password
Step 3: Test SMTP Connection
Test from the command line:
# Install swaks (Swiss Army Knife for SMTP)
sudo apt install swaks -y
# Test authentication
swaks --to [email protected] \
--from [email protected] \
--server mail.yourdomain.com \
--port 587 \
--auth LOGIN \
--auth-user [email protected] \
--auth-password "yourpassword" \
--tls
Step 4: Check Server-Side Authentication
On cPanel/WHM servers, verify SMTP auth is enabled:
# Check Exim config for auth
grep -i "auth" /etc/exim.conf | head -10
# In WHM: Service Configuration → Exim Configuration Manager
# Ensure "Allow SMTP Authentication" is enabled
Step 5: Check Firewall
# Check if port 587 is open (UFW)
sudo ufw status | grep 587
# Open port 587 if blocked
sudo ufw allow 587/tcp
# For CSF firewall
grep "TCP_OUT" /etc/csf/csf.conf
# Ensure 25,465,587 are in the TCP_OUT list
Step 6: Fix WordPress SMTP
If using WordPress with WP Mail SMTP plugin:
- Go to WP Admin → WP Mail SMTP → Settings
- Set Mailer to "Other SMTP"
- Enter your SMTP host, port 587, TLS encryption
- Enable authentication and enter credentials
- Use the built-in "Email Test" to verify
Verify Your Fix
# Send test email via swaks
swaks --to [email protected] --from [email protected] --server mail.yourdomain.com --port 587 --auth LOGIN --auth-user [email protected] --auth-password "pass" --tls
# Check Exim log for success
tail -20 /var/log/exim_mainlog | grep "[email protected]"
Common Mistakes
- Using "username" instead of full email: SMTP auth requires
[email protected], not justuser - Copy-paste password errors: Hidden characters from copy-paste. Type the password manually.
- SSL on port 587: Port 587 uses STARTTLS, not SSL. Port 465 uses SSL. Don't mix them.
- Server hostname mismatch: Use the hostname that matches your SSL certificate to avoid TLS errors.
- Account rate-limited: Too many failed login attempts can temporarily lock the account.
🚀 Need Help With Email Deliverability?
QIW Host can configure SPF, DKIM, DMARC, PTR and SMTP correctly on your server — so your emails land in the inbox, not the spam folder.
Get Reliable Hosting →Frequently Asked Questions
What's the difference between port 587 and 465?
Port 587 uses STARTTLS (starts unencrypted, upgrades to TLS). Port 465 uses implicit SSL/TLS (encrypted from the start). Port 587 is the modern standard recommended by RFC 6409.
Why does SMTP work in webmail but not in Outlook?
Webmail uses a different authentication path (HTTP). Outlook connects directly via SMTP, which requires the correct port, encryption, and server hostname. Double-check all three settings.
Can I test SMTP without an email client?
Yes. Use swaks (shown above), openssl s_client, or telnet to test SMTP connectivity and authentication directly from the command line.
How do I fix SMTP auth failed in PHP/Laravel?
Check your .env file settings: MAIL_HOST, MAIL_PORT, MAIL_USERNAME (full email), MAIL_PASSWORD, and MAIL_ENCRYPTION (tls for 587, ssl for 465). Clear config cache with php artisan config:clear.