note 24889 added to function.mail

From: Date: Tue, 03 Sep 2002 23:23:17 +0000
Subject: note 24889 added to function.mail
Groups: php.notes 
Request: Send a blank email to php-notes+get-36083@lists.php.net to get a copy of this message
I'm using PHP4.2.2 on FreeBSD, there is a strange things that happaned when I try to send mail with extra headers. When I use this: $Headers = "From: info@$SERVER_NAME\r\nReply-To: info@$SERVER_NAME"; mail($To, "$SERVER_NAME Order Confirmation", $Message, $Headers); I receive the message, but From is not correct and Reply-To is not correct too, the domain of the From and Reply-To mail addresses are replaced with the real hostname. Let's say I have a virtual web host, hosted at realdomain.com, and a virtual name my_name.com, and in headers, it must be info@my_name.com, but it's appear as info@realdomain.com. If I just use mail($To, $Subject, $Message, "From: info@my_name.com\r\nReply-To: info@my_name.com"); everything is OK, but I want to use this script on multiple domains. Where is the problem?? -- http://www.php.net/manual/en/function.mail.php http://master.php.net/manage/user-notes.php?action=edit+24889 http://master.php.net/manage/user-notes.php?action=delete+24889 http://master.php.net/manage/user-notes.php?action=reject+24889

« previous php.notes (#36083) next »