Heya guys,
I'm kinda new to php, and I'm trying to get the mail() function working properly. Let me start by supplying some code:
<?php
$to = "bboystu@yahoo.co.uk";
$from = "from: <email address>";
$subject = "test using the mail function 2nd attempt!";
$msg = "test email";
$mailheaders = "MIME-Version: 1.0\r\n";
$mailheaders .= "Content-type: text/html; charset=iso-8859-1\r\n";
mail ($to, $subject, $msg, $mailheaders, $from);
?>
Now, what happens is the email gets sent to the $from address. However, when reading the email, it says that the To: address is the one at $to. Also, the From: address is set to apache@servername.co.uk.
This is really annoying me! Any help would be appreciated. For the record, the server is running Linux. Thanks in advance!
Stu