Started with something simple: an e-mail form... I am building two different sites that are both hosted on go daddy...
I got one e-mail form to work fine, works exactly the way I programmed it.
So, I make one for my second site, and nothing.... It is not delivering the message to the email address.
What in the world am I doing wrong...
This code works:
<?php
$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$comments =$_POST['comments'];
$msg = "Tony, \r\n" .
$msg = "$first_name $last_name has sent you the following message:\r\n" .
$msg = "$comments\r\n" .
$msg = "Their phone number is $phone and the E-Mail address is $email";
$to = 'xxxxxxx@gmail.com';
$subject = 'E-Mail From TCBeeFarm.com';
mail ($to, $subject, $msg, 'From:' . $email);
echo 'Thank you ' . $first_name .' ' . $last_name . ' your message has been sent' ;
?>
This code Does NOT WORK. Why?!?!?!
<?php
$email = $_POST['email'];
$to = 'xxxxxxxxx@gmail.com';
$subject = 'yo';
$body = $email . 'Wants to be added to calendat contacts';
if (mail($to, $subject, $body)) {
echo("<p>Message successfully sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");
}
echo $email;
?>