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
Isaac Russell
12,091 PointsTesting & Deploying forms:
I'd like to say Randy is doing an excellent job with the php tutorials. I've really been enjoying them and learning alot however I am bit confused about forms. I followed the php tutorial up to the point in which Randy refers to his blog: http://blog.teamtreehouse.com/sending-email-with-phpmailer-and-smtp. I got lost right away when he says "First, place the two necessary files on your server: class.phpmailer.php class.smtp.php. Does this mean on my localhost server? Or on a hosted server? Its a lot easier following along with the videos because I can see where exactly the files are going. It has more context. I feel being directed to the blog doesn't give enough context for beginners. It is lacking the context. For example the php tutorial goes through the entire process with setting up the checkout process with paypal video and each step by step click by click. I think the same should have been done with the form. It's a major component of almost every website. Anyways, I signed up with Postmark and still a bit confused as to where I should put the class.phpmailer.php and class.smtp.php files. Currently I created a folder for each of them with their perspective names and put them in there under the includes folder (on my localhost server) I'm using mamp. What should I do next? Thanks for the help in advance.
1 Answer
Mike Gabriel
8,402 PointsI had a glance at the blog post and it should work from either server (local or remote). The scripts are configured to use postmarkapp therefore you have no worry about running a mail daemon (local or remote).
It sounds like you should just continue with the tutorial, setup the mailer settings as indicated.
require_once('path/to/library/class.phpmailer.php');
$mail = new PHPMailer();