About sending emails
Briefly

A common issue when using PHPMailer with Gmail is failing to connect due to incorrect SMTP settings. Ensure your SMTP_HOST is set correctly to 'smtp.gmail.com'.
The SMTP_PORT for Google’s SMTP server varies; for SSL it should be 465 and for TLS, it's generally 587. Adjust your configuration accordingly.
If you encounter 'SMTP connect() failed' errors, consult the PHPMailer troubleshooting documentation. There are common pitfalls like firewall issues or incorrect credentials.
Setting the debug level to 2 will provide a more detailed output regarding what goes wrong during the SMTP connection attempt.
Read at SitePoint Forums | Web Development & Design Community
[
|
]