"From" in mail() header problem.
| From: | Rahul S. Johari | Date: | Wed, 18 May 2005 13:25:26 +0000 |
| Subject: | "From" in mail() header problem. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-215469@lists.php.net to get a copy of this message | ||
Ave,
I¹ve written a simple script to send a mail out in HTML format to the
recipient. Everything is working fine... Except the ³From² header. The
recipient receives the email from ³World Wide Web Server <www@mydomain.com>²
instead of what I have specified. Here¹s my code...
<FORM action="<?php echo $PHP_SELF; ?>" method="post"
name="one"><TEXTAREA
name="desc" cols="20" rows="5"></TEXTAREA><INPUT
name="Submit" type="submit"
value="Submit"></FORM>
<?
if($Submit) {
$to = "myemail@something.com";
$subject = "SOMETHING : File Upload Notification";
$message = "
<html><head></head>
<body>
Hi,
<br><br>
You have recieved a new file in the Something File Manager, with the
following details:
<br><br>
Name: One<br>
Size: 94685 Bytes<br>
Description: $desc<br>
Date: $now
<br><br>
Please visit <b>SOMETHING File Manager</a></b> to login to your account and
download the file.<br>
This is an automated notification email. Please do not reply to this email.
<br><br>
Regards,<br>
SOMETHING<br>
</body></html>
";
$message = stripslashes($message);
mail($to,$subject,$message,'Content-type: text/html; charset=iso-8859-1;
From: SOMETHING <something@something.com>; Reply-To: myemail@something.com;
MIME-Version: 1.0; X-Mailer: PHP/' . phpversion());
echo "It is done";
}
?>
... I don¹t know what I¹m doing wrong, it¹s not reading the FROM or Reply-TO
in the headers. Instead of the mail stating ³Something
<something@something.com>² at the recipient¹s end, it is stating ³World Wide
Web Server <www@mydomain.com>² .. I have no clue why.
Thanks,
Rahul S. Johari
Coordinator, Internet & Administration
Informed Marketing Services Inc.
251 River Street
Troy, NY 12180
Tel: (518) 266-0909 x154
Fax: (518) 266-0909
Email: rahul@informed-sources.com
http://www.informed-sources.com