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

**URL:** <https://forum.infinityfree.com/t/smtp-connect-failed-on-infinityfree-but-not-on-xampp-localhost/49430>\
**Category:** Hosting Support\
**Created:** [August 5, 2021, 3:20am UTC](https://forum.infinityfree.com/t/smtp-connect-failed-on-infinityfree-but-not-on-xampp-localhost/49430 "2021-08-05T03:20:34Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Greenreader9](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/greenreader9/32/22847_2.png) [@Greenreader9](https://forum.infinityfree.com/u/Greenreader9)\
**Post date:** [August 5, 2021, 12:24pm UTC](https://forum.infinityfree.com/t/smtp-connect-failed-on-infinityfree-but-not-on-xampp-localhost/49430/4 "2021-08-05T12:24:16Z")

</div>

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.

---

_[View the full topic](https://forum.infinityfree.com/t/smtp-connect-failed-on-infinityfree-but-not-on-xampp-localhost/49430)._
