"SMTP connect() failed" on InfinityFree but not on XAMPP Localhost

Try this.

  1. Ensure that “Less Secure Apps” is enabled in your Google Account Settings.

  2. Turn on 2Fa (Two Factor Authorization) on your Google account

  3. Generate an App Password for your account (It’s under “Privacy”) and use that instead of your real password.

  4. Apply the changes and upload to the server

  5. Clear your cache and cookies and let me know if it works.

2 Likes