PHP email issue
Posted: Fri Apr 30, 2010 4:41 pm
I'm new at this and at my wits end..
I have this PHP form that goes with my contact form (as you can tell). When I upload the PHP to the web and click the submit button on my contact form, I get a blank page that comes up. This blank page is suppose to say message sent and plus on top of that I don't get the message in the email. I'm totally lost. I've tried different configurations and I'm not sure what I can do to fix this. If there's anyone who could take a look at this and tell me what's going on I would absolutely appreciate it.
-Zerbe32
<?php
if (isset($_POST['submit'])){
$to = "example@hotmail.com";
$subject = "You have a message";
$name_field = $_POST['Name'];
$email_field = $_POST['Email'];
$tel_field = $_POST['Tel'];
$message = $_POST['Message'];
$body = "From: $name_field\n E-Mail: $email_field\n Tel:\n $tel_field\n Message:\n $message";
echo "Data has been submitted to $to!";
if (mail($to, $subject, $body)){
} else {
echo "Message Sent";
}
}
?>
I have this PHP form that goes with my contact form (as you can tell). When I upload the PHP to the web and click the submit button on my contact form, I get a blank page that comes up. This blank page is suppose to say message sent and plus on top of that I don't get the message in the email. I'm totally lost. I've tried different configurations and I'm not sure what I can do to fix this. If there's anyone who could take a look at this and tell me what's going on I would absolutely appreciate it.
-Zerbe32
<?php
if (isset($_POST['submit'])){
$to = "example@hotmail.com";
$subject = "You have a message";
$name_field = $_POST['Name'];
$email_field = $_POST['Email'];
$tel_field = $_POST['Tel'];
$message = $_POST['Message'];
$body = "From: $name_field\n E-Mail: $email_field\n Tel:\n $tel_field\n Message:\n $message";
echo "Data has been submitted to $to!";
if (mail($to, $subject, $body)){
} else {
echo "Message Sent";
}
}
?>