Problem
Many WordPress users encounter the “Could not connect to SMTP host” error when sending emails from contact forms or WooCommerce.
Solution Overview
This error typically means the SMTP credentials are incorrect, blocked, or the server rejects the connection.
Step-by-Step Fix
Verify SMTP credentials
Username = your full email address
Password = correct SMTP password or app password (if using Gmail, Outlook, etc.)
Check SMTP Port & Encryption
Port 587 with STARTTLS (recommended)
Port 465 with SSL (for older setups)
Check if SMTP is blocked
On VPS run: telnet smtp.gmail.com 587
Contact host to whitelist SMTP outbound ports
Plugin setup (example: WP Mail SMTP)
Use built-in diagnostics tool
Check logs under “Email Log” plugin
Enable less secure apps (Gmail workaround)
Or better: use Gmail App Passwords with 2FA enabled
Extra Tips
- Avoid sending through your shared hosting SMTP
- Consider using a transactional email service like SendGrid or Mailersend