Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress How to Install WordPress on Your Computer How to Install WordPress on Your Computer How to Enable Email for WordPress on Your Computer

I have tried your easy wp smtp plugin, but it's not working. I get error: SMTP connect() failed.

Hi I have tried the easy wp smtp plugin, but it's not working. I followed all the steps as shown in the video, but it gives me the following error:

SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

Can anyone help?

Thanks

Alena Holligan
Alena Holligan
Treehouse Teacher

can you share the settings you are using? If you are using gmail, make sure you change the SMTP Host to smtp.gmail.com

8 Answers

Alena Holligan
STAFF
Alena Holligan
Treehouse Teacher

Yahoo and Gmail will both require that an App Password be setup. The wont just let an "insecure app" connect.

If you want to connect to gmail, you'll need to setup 2-step authentication then Create a Gmail Application Specific Password https://www.lifewire.com/get-a-password-to-access-gmail-by-pop-imap-2-1171882

If you want to connect to yahoo smtp, you're required to either "turn on two-step verification"or "enable yahoo account key". See more here https://help.yahoo.com/kb/create-third-party-password-sln15241.html

Hi, I followed these instructions. I have Gmail 2-step verification on and created an app password to use in the form for EasyWP SMTP plugin on the local WordPress install with MAMP. Everything is entered correctly and I still get this error message:

CLIENT -> SERVER: EHLO localhost CLIENT -> SERVER: STARTTLS SMTP Error: Could not connect to SMTP host.CLIENT -> SERVER: QUIT SMTP ERROR: QUIT command failed: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

Any ideas? Thanks!

John Lukacs
John Lukacs
26,806 Points

I am having the same issue. Everything was done just like you. Using a gmail account. Its not working this is the message I get SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting smtp.gmail.com TSL 587

I am having the same issue too, please help us out. Thank you coaches.

Alena Holligan
STAFF
Alena Holligan
Treehouse Teacher

Do you have 2 factor authentication setup? You'll have to use an app password https://support.google.com/accounts/answer/185833?hl=en

Good day mam. I think my wordpress cannot connect to the plugins repository of wordpress.org because when I search plugins in the wordpress admin, it doesn't load anything so I downloaded the plugin from the website and install it manually. I use yahoo for my SMTP settings, I did follow the step accurately and I still get the "SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting" error. I don't use 2-factor authentication on my email account.

I use XAMP and my local web server and MySQL because I a using a windows computer.

May I ask if I need to configure some settings in my XAMP or in the Wordpress Admin?

Genesis FX
Genesis FX
763 Points

I'm also having this problem - have followed all the steps above, setup 2-step authentication, and have generated an app password, but it's just not working.

Any ideas?

Alena Holligan
Alena Holligan
Treehouse Teacher

Brigid Cappello what email provider are you using, and what is the error exact error you receive?

Genesis FX
Genesis FX
763 Points

Thanks for the quick response, Alena Holligan .

I am using Gmail, and have set up an app password as per the instructions you posted, but I'm still getting the same error message:

CLIENT -> SERVER: EHLO localhost CLIENT -> SERVER: STARTTLS SMTP Error: Could not connect to SMTP host.CLIENT -> SERVER: QUIT SMTP ERROR: QUIT command failed: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

Thanks in advance.

Alena Holligan
Alena Holligan
Treehouse Teacher

Do your settings look like this https://github.com/PHPMailer/PHPMailer/blob/master/examples/gmail.phps

Can you post a "snapshot" of your workspace or share your code?

Reminder: DO NOT SHARE YOUR PASSWORD ;) although if it's actually an app password you can easily revoke that and add a new one

I had the same issue. All of my information was correct. The authentication attempts were being blocked by gmail. I later learned via an email they sent informing that a “less secure app” was attempting to authenticate. I followed the instructions in their email to allow “less secure app” and it began working after the permission was enabled.