I am working on an email form for someone who is hosting their site on Yahoo.
When I test the email form on Yahoo the email is not being sent or received from the form. I do not receive an error.
I have tested the form and script where I host my own site and the form works fine. It sends and I receive the email with no problem. However when I attempt to use the form on the site hosted by yahoo the email is not being sent or received.
Can anyone help me figuire out what I am doing wrong. Please...
<?php
$name_text = trim($_GET['name_text']);
$email_text = trim($_GET['email_text']);
$phone_text = trim($_GET['phone_text']);
$comment_text = trim($_GET['comment_text']);
$subject_text = trim($_GET['subject_text']);
//$urgent = $_GET['urgent_var'];
// next 3 lines, cleans up the comment text in case you don't want line breaks. Probably isn't neccessary here, so I'm commenting it out. Worth noting though that line breaks can come through.
// $comment_text = strip_tags($comment_text);
// $comment_text = str_replace("\r", " ", $comment_text);
// $comment_text = str_replace("\n", " ", $comment_text);
if ($email_text != NULL){ //
$from = $email_text;
//$headers = "From: $from";
$headers = "MIME-Version: 1.0\r\n";
//$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$headers .= "X-Priority: 3\r\n";
$headers .= "X-MSMail-Priority: Normal\r\n";
$headers .= "X-Mailer: php\r\n";
$headers .= "X-Sender: me@me.com\r\n";
$headers .= "From: $from";
$headers .='Cc: me@me.com';
$email_to = 'me@me.com';
$subject = $subject_text ;
$message = "Name: " . $name_text . "\n";
$message .= "Email: " . $email_text . "\n\n";
$message .= "Phone Number: " . $phone_text . "\n\n";
//$message .= "Urgent: " . $urgent . "\n\n";
$message .= "Comments: \n" . $comment_text . "\n\n";
mail($email_to , $subject , $message, $headers ); // sends an email
echo 'var1=yes&successMessage=Your Email Was Sent';
}
?>