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 trialJoshua Bowden
Full Stack JavaScript Techdegree Graduate 29,312 PointsI can't find the class.phpmailer.php file on github
I can't find the class.phpmailer.php file on github can someone link it?
5 Answers
Matt Brock
28,330 PointsHey Josh, are you looking for the class itself? Here it is: https://github.com/PHPMailer/PHPMailer/blob/master/src/PHPMailer.php.
Joshua Bowden
Full Stack JavaScript Techdegree Graduate 29,312 PointsI am not sure the lesson says to include the file class.phpmailer.php which I can't find there.
Matt Brock
28,330 PointsYou could create a new file called class.phpmailer.php
and just copy/paste the contents from that Github page. It looks like the maintainers have re-organized the Github repo a bit.
Matt Brock
28,330 PointsYep... in her video, the current PHPmailer version is 5.2.14, which was released Nov. 2, 2015.
Dave StSomeWhere
19,870 PointsYep, the new version doesn't have that class individually for download. The instructions show how to do it that way, but I chose to adjust and use the new version following the recommended install via composer locally. It was straight forward and also added in using the gmail SMTP server to actually send mail (was in the examples). Just let me know if you want any details.
Joshua Bowden
Full Stack JavaScript Techdegree Graduate 29,312 PointsI figured it out. Thanks!
Matt Brock
28,330 PointsSweet!
ilanaguttman
2,700 PointsI'm having the same problem. Not following the solution.
aeimskei
9,077 PointsLooks like there was a massive update on the PHPMailer. I hope this will help you. I had to read the docs on GitHub to figure it out. Some tinkering around, finally got it.
Rather than one file, you actually will need two files added into your inc/phpmailer folder (1) Exception.php (2) PHPMailer.php
Next, in your suggest.php file, at the top write after the first line <?php you'll need to include:
use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception;
Then, in where our instructor, Alena, says to include the require, there's two lines of code needed:
require 'inc/phpmailer/Exception.php'; require 'inc/phpmailer/PHPMailer.php';
The last difference is the following:
$mail = new PHPMailer(true);
The if-statement for ValidateAddress is still the same as instructed.