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 trialJulian McNeill
9,445 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,149 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,149 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,445 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?