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!
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

Adam Smallman
4,182 PointsPhP Form, Nothing being received No error message
Hi guys, so I have followed everything that Randy said on the video but nothing is coming from the form after it sends, I get the "Message Sent" but nothing comes to the receiving email The mailer does not seem to work. Maybe it is a case of time but that seem unlikely since some 10 mins have past!
I am using Go Daddy To test out the mailer and the Go Daddy Email that comes with it. I have two files that was needed with the mails,
class.phpmailer.php and PHPMAILERAUTOLOAD.php (There is an error without the AutoLoad file)
This is the ENTIRE code from the process.php file
<?php
$name = trim($_POST ["name"]);
$email = trim($_POST ["email"]);
$message = trim($_POST ["message"]);
if ($name == "" OR $email == "" ) {
echo "Opps! Did you leave out your name and or email?";
exit;
}
foreach( $_POST as $value ){
if ( stripos($value, "Content-Type:") !== FALSE) {
echo "There was a problem with the information.";
exit;
}
}
if($_POST["address"] != "") {
echo "Your form submission has an Error.";
exit;
}
require_once("class.phpmailer.php");
$mail = new PHPMailer();
if (!$mail->ValidateAddress($email)) {
echo "You must specify a valid email address";
exit;
}
$email_body = "";
$email_body = $name_body . "Name: " . $name . "<br>";
$email_body = $email_body . "Email: " . $email . "<br>";
$email_body = $message_body . "Message: " . $message;
$mail->SetFrom($email, $name);
$address = "MyEmail@Mail.com";
$mail->AddAddress($address, "Another Titiel");
$mail->Subject = "SUBJECT " . $name;
$mail->MsgHTML($email_body);
if(!$mail->Send()) {
echo "There was a prolem sending the email: " . $mail->ErrorInfor;
exit;
} else {
echo "Message Sent!";
}
?>
I have tested this with gmail also to make sure that the falut is not with Go Daddy's email server.
There must be something I am missing somewhere.
Should I follow the blog post that Randy did to fix the issue? But since I am getting no error message I thought that there must be another issue. I do get "Message Sent"
Thanks guys!
1 Answer

Adam Smallman
4,182 PointsJust to let you guys know, I have found the source of the issue but not yet fixed. The issue was with Go Daddy. They seem to block the email in favor of anti-spam. I have found some help from Go Daddy to fix the issue!
Adam Smallman
4,182 PointsAdam Smallman
4,182 PointsI have been taking a look around and still could not find anything, I must be missing something somewhere