I have added a contact form to my website that requests the following fields:
Name(required)
Phone(required)
Email(required)
best time to call
time zone
comments
The problem is that, when I get the notification email telling me that I got a callback request,
MY email appear in the "from" field. Subject "Callback Request", and then, the major problem.
The body of the email is empty.
I get the names of the field in the email, but then the information entered is not sent in the email.
Basically, I just get a blank email from myself. With all the fields empty.
Here's the code:
***** PLEASE USE THE CODE OR PHP TAG WHEN POSTING *****
Code: Select all
<?php
if ($_POST['name'] != "" && $_POST['email'] && $_POST['best_phone'] ) {
$subject="CallBack Request";
$ip=$_SERVER["REMOTE_ADDR"];
$host = $ip;
$mon=date(m);
$day=date(j);
$year=date(y);
$hour=date(g);
$min=date(i);
$sec=date(s);
$hour=$hour-2;
if($hour<=0) { $hour+=12; }
$ts = "$hour:$min:$sec on $day/$mon/$year";
$to="ariel@thewealthpath.com";
$body="
Your Name = $name
Your Email = $email
Best Phone = $best_phone
Best Time To Call = $best_time_to_call
Your Time Zone = $your_time_zone
Comments = $comments
Host: $host
Time: $ts";
$email = "From: $name <$to>";
mail($to, $subject, $body, $email);
Header("Location: http://www.mysite.com/thankyou.html");
}
?>