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 trialSean Flanagan
33,235 Points"Invalid email address"
Hi.
I put my email address in the Email field and click Send but all I get is a white screen with the above message. Why is that?
Darrell Conklin
Python Development Techdegree Student 22,377 Pointshttps://teamtreehouse.com/community/invalid-email-address-message-with-valid-emailhelp
This was the problem however you get a 502 Bad Gateway error when using your smtp settings. If you remove the smtp from the code it works as it did in the video.
PS You should probably change your gmail password now since you left it in your snapshot for others to see.
Sean Flanagan
33,235 PointsSo even if I fill out all the fields on the form, I'll still get that message?
Darrell Conklin
Python Development Techdegree Student 22,377 PointsFollow the instructions in the link I provided and remove the smtp settings in your code and it should work just fine.
Remove the following lines to remove smtp settings.
$mail->isSMTP();
$mail->SMTPDebug = 2;
$mail->Host = 'smtp.gmail.com';
$mail->Port = 587;
$mail->SMTPSecure = 'tls';
$mail->SMTPAuth = true;
$mail->Username = "your email";
$mail->Password = "your password";
Sean Flanagan
33,235 PointsHi Darrell Conklin.
I got rid of those lines and changed the $email and $details operators. It now goes to the Thanks page.
Thanks for your help.
Sean
Darrell Conklin
Python Development Techdegree Student 22,377 PointsYou are very welcome :)
1 Answer
Spenser Hale
20,915 PointsHey Sean and Darrell,
It would be good for the community to have an answer selected as best answer so this questions is not listed in the unresolved section.
Darrell Conklin
Python Development Techdegree Student 22,377 PointsDarrell Conklin
Python Development Techdegree Student 22,377 PointsIf you post your code or a snapshot of your Workspace I'd be happy to take a look. My personal suggestion would be to look back over your code for typos or other errors ... we all make them.