I’m having a problem with the mail() function. I’m doing up a clients site and have a form feeding into a mail() function. I know the php mail system works on my server because I have a contact page on my main site that feeds info through a flash file to a php file which sends the e-mail to my address.
I’ve put in my own e-mail address to this client’s site for testing purposes, but don’t seem to be getting any e-mails or error reports. I have no inbox items or anything showing up in my spam.
This is my code, I need help asap.
$firstName = $_POST[‘firstName’];
$lastName = $_POST[‘lastName’];
$studentEmail = $_POST[‘studentEmail’];
$name = $firstName. " " .$lastName;
$to = "[email protected]"; $from = $studentEmail; $subject = "New Student Booking : " .$name;
//Start Of Message
$message = <<<EOF
Email = $studentEmail
Message = "Message"
EOF; //End of message
$headers = “From: $from\r\n”;
$headers .= “Content-type: text/html\r\n”;
mail($to, $subject, $message, $headers);
echo “Mail Sent.”;