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

PHP

Charles Moeller
Charles Moeller
776 Points

Sending a contact form

My website works perfectly after completing the Shirts For Mike php shopping website. My question now is how do I know if the contact form actually works? Iv'e tried changing the shirts for mike email to my own and sending it. There was no error but it didnt appear on my inbox.

2 Answers

Kevin Korte
Kevin Korte
28,149 Points

I'm assuming that this is running on a local web server. Meaning you're using something like XAMPP, MAMP, WAMP, etc to run the PHP code on your computer, and this isn't live on the internet somewhere?

If that's the case, there are extra steps to be taken to get a website that is running on a local server to be able to send emails.

The stack overflow question below should provide that answer for you.

http://stackoverflow.com/questions/19132171/send-email-from-localhost-running-xammp-in-php-using-gmail-mail-server

Charles Moeller
Charles Moeller
776 Points

thanks this did help a lot and made sense. When I put this live on the internet and not off a local server do you think I would have to alter the code again to send the form?

Kevin Korte
Kevin Korte
28,149 Points

I don't know enough about the actual details of the code in action to answer that. Likely it should work without changing anything, but I'm not sure.