<?php
$name=$_GET['name'];
$email=$_GET['email'];
$comments=$_GET['comments'];
$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
// target email address
$youremail = "mail@XXXXXXXXX.com.au"; //edited for kF
// send email
$headers = "From: \"".$email."\"
";
$subject = "Contact Form from fundamental.net.au";
$message = "Name: $name
Email: $email
IP Address: $hostname
Message: $comments";
mail ("$youremail", "$subject", $message, $headers)
?>
I always use this exact same code for all my sites, but this is the first time I’m running a site off a Windows server, and apparently there are some slight discrepancies with the layout of the $headers bit (you can’t have formatting within the headers). So I stripped down the $headers to display only the sender’s email address, as per the instructions I found.
I execute the script… no warnings… but the email doesn’t seem to come through :-/
Any ideas?