Re: "From" in mail() header problem.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Rahul S. Johari wrote:

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@xxxxxxxxxxxx>²
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@xxxxxxxxxxxxx"; $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@xxxxxxxxxxxxx>; Reply-To: myemail@xxxxxxxxxxxxx; MIME-Version: 1.0; X-Mailer: PHP/' . phpversion()); echo "It is done"; } ?>



Those should not be separated by semicolons (;) , you should use \r\n. So...

mail($to,$subject,$message,"Content-type: text/html\r\ncharset=iso-8859-1\r\nFrom: SOMETHING <something@xxxxxxxxxxxxx>\r\nReply-To: myemail@xxxxxxxxxxxxx\r\nMIME-Version: 1.0\r\nX-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@xxxxxxxxxxxxx>² at the recipient¹s end, it is stating ³World Wide
Web Server <www@xxxxxxxxxxxx>² .. 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@xxxxxxxxxxxxxxxxxxxx
http://www.informed-sources.com





-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux