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 <[EMAIL PROTECTED]>� 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 = "[EMAIL PROTECTED]"; $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 <[EMAIL PROTECTED]>; Reply-To: [EMAIL PROTECTED]; 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 <[EMAIL PROTECTED]>\r\nReply-To: [EMAIL PROTECTED]: 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 <[EMAIL PROTECTED]>� at the recipient�s end, it is stating �World Wide Web Server <[EMAIL PROTECTED]>� .. 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: [EMAIL PROTECTED] http://www.informed-sources.com
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

