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

Andrew Rico
Andrew Rico
2,257 Points

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

im getting this error after testing the email.

2 Answers

I remember having this problem myself. After brilliantly failing to get it to work properly (mostly due to a dire lack of patience at the time), I opted for a workaround. So, if you're using XAMPP on Windows, you can do as I did. Skip this part. Instead, I use Mercury email service (included in XAMPP for Windows). But, it is not included for Linux (uses php-mail). As for Mac, I am uncertain. Other than that (without knowing which OS you're using), my next best recommendation would be to look through all the online posts regarding this very problem. Hope this helps.

I don't get why Treehouse don't address these questions, when it's clear that so many members are having the same problem! Just look through the questions section of this video, it's so obvious. For a paid service you'd reckon they'd be more on the ball with this kind of thing.

The answer to your question, Google have removed the ability to use SMTP from a third party (such as Wordpress) unless you explicitly tell it to. In order to do this, you have to remove 2-Factor Authentication, which I don't think is worth it if you're using your personal Gmail account.

So your options are a) Make a throwaway gmail account, b) remove 2-Factor on your personal email (bad) or c) Skip this feature. This article explains everything pretty well. Hope this helped!