Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Julian McNeill
9,444 PointsHELP! When testing a contact form?
Do the files have to be on the server for the the contact form to actually send an email
3 Answers

James Barnett
39,199 PointsInstalling a server like postfix is a lot of trouble if all you want to do is test email. Try using something like Mandrill instead.
Or you can try using SSMTP

Kevin Korte
28,135 PointsYes, as far as I know you can not test a contact form from a local server (ie a computer). If you put your file(s) that process and send the email on your live server, and make sure your form submits to those files even if the site files are still locally on your computer, the email should send.
An example of this would be if you were developing a wordpress site locally, and was using a plugin for a form like Contact Form 7, even though your site is still local, testing the form works and you'll get an email because it's using a live email server.

Chase Lee
29,275 PointsI know there is a way to setup emails on your local server in the console. I believe the commands are:
sudo postfix start
mail
sudo postfix flush
sudo postsuper -d AL
Note: That last one might be sudo postsuper -d ALL
.

Chase Lee
29,275 PointsFollow the instructions on this site. If you have a Mac.

Kevin Korte
28,135 PointsThat is cool!

James Barnett
39,199 PointsPostfix is way overkill for this, usessmtp
instead. Here's how to use PHP using SSMTP to deliver email

Julian McNeill
9,444 PointsThanks a lot for the answers. I have one more question. I want a modal to popup after you hit submit on the contact form do I just replace the redirect if ($success) code?