SMTP Troubleshooting Guide
Comprehensive guide to diagnosing and fixing SMTP problems. Learn how to troubleshoot common SMTP errors, connection issues, authentication failures, and email delivery problems.
Before diving into troubleshooting, use our SMTP test tool to identify the exact issue with your email server configuration.
Run SMTP Diagnostic TestConnection Refused / Connection Timeout
Error Code: ECONNREFUSED, Connection timed out
Possible Causes:
- •SMTP server is down or not responding
- •Firewall blocking the SMTP port (25, 587, 465)
- •Incorrect SMTP server hostname or IP address
- •ISP blocking outbound SMTP connections
- •Wrong port number specified
Solutions:
- Verify server address: Double-check the SMTP hostname (e.g., smtp.gmail.com)
- Check port number: Use 587 (STARTTLS), 465 (SSL), or 25 (rarely used)
- Test connectivity: Use telnet or ping to verify network connectivity
- Check firewall: Ensure outbound connections on SMTP ports are allowed
- Try different network: Test from another network to rule out ISP blocking
Authentication Failed
Error Code: 535, 535-5.7.8, Authentication credentials invalid
Possible Causes:
- •Incorrect username or password
- •App-specific password required (Gmail, Microsoft)
- •Two-factor authentication not configured properly
- •Wrong username format (some require full email, others just local part)
- •Account locked or disabled
Solutions:
- Verify credentials: Double-check username and password are correct
- Gmail: Enable 2FA and generate an app-specific password
- Office 365: Use full email address as username
- Check account status: Ensure account is active and not locked
- Test authentication: Try logging into webmail with same credentials
Relay Access Denied
Error Code: 554, 550, Relay access denied
Possible Causes:
- •SMTP server requires authentication but none provided
- •IP address not whitelisted for relay
- •Relay permissions not configured on server
- •Sending to external domain without proper permissions
Solutions:
- Enable authentication: Provide valid SMTP credentials
- Whitelist IP: Add your server IP to relay whitelist
- Configure relay: Update SMTP server relay settings
- Use authenticated SMTP: Switch to authenticated relay service
SSL/TLS Certificate Errors
Error: Certificate verification failed, SSL handshake failed
Possible Causes:
- •Expired SSL/TLS certificate
- •Self-signed certificate not trusted
- •Certificate hostname mismatch
- •Wrong encryption method (SSL vs STARTTLS)
- •Outdated SSL/TLS protocol version
Solutions:
- Update certificate: Renew expired SSL/TLS certificates
- Match hostname: Ensure certificate CN matches server hostname
- Use correct port: Port 587 for STARTTLS, 465 for SSL/TLS
- Update TLS version: Use TLS 1.2 or higher
- For testing: Temporarily disable certificate verification (not for production)
Invalid Recipient / User Unknown
Error Code: 550, 550-5.1.1, User unknown
Possible Causes:
- •Email address does not exist
- •Typo in recipient email address
- •Recipient's mailbox has been deleted
- •Domain doesn't accept mail
Solutions:
- Verify address: Double-check recipient email address for typos
- Check domain: Verify the domain has valid MX records
- Confirm mailbox: Ensure recipient mailbox still exists
- Test with known address: Try sending to a verified email first
Test Basic Connectivity
Verify you can reach the SMTP server:
telnet smtp.gmail.com 587Verify DNS Configuration
Check MX records and DNS resolution:
nslookup -type=MX gmail.comTest SSL/TLS Connection
Verify SSL/TLS handshake:
openssl s_client -starttls smtp -connect smtp.gmail.com:587Check Authentication
Test SMTP authentication with your credentials using our online tool or command-line utilities.
Review Server Logs
Check SMTP server logs for detailed error messages and connection attempts. Look for patterns or recurring issues.
Test from Different Location
Try connecting from a different network or server to isolate whether the issue is network-related or configuration-related.
Gmail SMTP Issues
- →"Less secure apps": Create an app-specific password instead
- →2FA required: Enable 2FA and generate app password
- →Captcha blocking: Sign in via browser first
Office 365 SMTP Issues
- →Modern Auth: May need OAuth2 instead of password
- →Username format: Always use full email address
- →Security defaults: Check tenant security settings
Amazon SES Issues
- →Sandbox mode: Verify recipient addresses first
- →SMTP credentials: Different from AWS access keys
- →Region-specific: Use correct regional endpoint
SendGrid Issues
- →API key as password: Use API key, not account password
- →Username: Always use "apikey" as username
- →Sender verification: Verify sender identity first
- Regular testing: Test SMTP configuration periodically to catch issues early
- Monitor logs: Set up logging and monitoring for SMTP connections
- Use TLS: Always use SSL/TLS or STARTTLS for secure connections
- Document settings: Keep detailed documentation of SMTP configurations
- Implement retries: Add retry logic with exponential backoff for transient failures
- Set up alerts: Configure alerts for authentication failures and connection errors
- Keep certificates updated: Renew SSL/TLS certificates before expiration
Still Having SMTP Issues?
Use our diagnostic tool to identify and fix SMTP problems instantly. Get detailed error analysis and step-by-step solutions.
Run SMTP Diagnostic