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 Building Websites with PHP Contact Form & Sending Email Sending Our Email

Franco Martínez
Franco Martínez
247 Points

problem with setFrom()

i have my code in the same way as the code in this video, however, when I click on preview button I get a blank page. I removed line by line to see where the problem was, and when I add this the page does not work:

$message->setFrom(array( $cleanEmail => $cleanName ));

please help me, i do not know what else to do.

Daryl Peterson
Daryl Peterson
7,812 Points

Turn on error logging in the top of the index file.

ini_set('display_errors',1);
ini_set('display_startup_errors',1);

// also check your transport
$transport = Swift_SendmailTransport::newInstance('/usr/sbin/sendmail -bs');

php