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 Build a Simple PHP Application Wrapping Up The Project Using A Third-Party Library

alex mattingley
alex mattingley
7,508 Points

Issues with Using a Third-Party Library code

Seem to be having issues with the PHPMailer object, but I am not sure why. If I have the contact form and I input any information and hit send I get a blank screen. If I remove the code added in the video (the same code posted below) everything executes as anticipated. I assume that means that the issue lies in this block of code:

require_once('inc/phpmailer/class.phpmailer.php');
$mail = new PHPMailer();


if (!$mail->ValidateAddress($email)){
    echo "You must specify a valid email address.";
    exit;
    }

Does anyone see any issues here?

Thanks in advance for your help!

alex mattingley
alex mattingley
7,508 Points

Figured it out, had to do with the PHPMailer code. Somehow I managed to download a version that was not complete so it was not working like it was supposed to.

Ashley Shay
Ashley Shay
8,664 Points

I'm having this same issue and can't seem to find a version that works. What did you finally find that worked for you?

2 Answers

Ashley Shay
Ashley Shay
8,664 Points

Thanks! It did help! :)