Mail not sent!!! HELP Please!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
cbermani3
Forum Newbie
Posts: 2
Joined: Thu Feb 11, 2010 11:49 am

Mail not sent!!! HELP Please!

Post by cbermani3 »

Okay OKay, I'm new to php and reading through books and books,
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?!?!?! :banghead:

<?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;
?>
cbermani3
Forum Newbie
Posts: 2
Joined: Thu Feb 11, 2010 11:49 am

Re: Mail not sent!!! HELP Please!

Post by cbermani3 »

Sorry on the second php code its not sending the mail to the recipient. I xxxx out the real addresses...
I'm not getting any error message; its just not sending the email. and for testing purposes I changed both to send e-mail to myself. One site works the other doesn't.
This one doesn't work.... the submit e-mail to mailing list.
http://www.strombergs.com/calendar.html
Post Reply