PHP mail not working
Posted by: wozie
Posted on: 2008-09-10 01:29:00
Hi all,
I have spent many a hour trying to figure out what I am doing wrong here, for some reason my "mail" function is not working on my account.... I think...?
Below is the code I am using to send mail from my website (without some of the gumf)...
$to = "james@blarblarblar.co.uk";
$subject = "Some kind of subject";
$message = "New email from someone\n";
$message .= "I would like more information on: ...";
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\n\t";
$headers .= "Content-Transfer-Encoding: 8bit\n\t";
$headers .= "From: My Site <my@site.com>\n\t";
$headers .= "X-Priority: 1\n\t";
$headers .= "X-MSMail-Priority: High\n\t";
$headers .= "X-Mailer: PHP/" . phpversion()."\n\t";
mail($to, $subject, $message, $headers);
Can anyone see any problems with this? It looks ok to me but would like a second opinion if possible.
If it looks ok, any ideas why it is not working?
Many thanks,
James