RE: [PHP-DB] From address in mail() header not working - ideas?
| From: | USA) | Date: | Thu, 24 Oct 2002 19:27:05 +0000 |
| Subject: | RE: [PHP-DB] From address in mail() header not working - ideas? | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-22669@lists.php.net to get a copy of this message | ||
I'd recommend trying to put the from at the beginning of your headers and check the result.
Also I'd verify that $name and $orderResult['email'] contains the data I expect. :-)
<>< Ryan
-----Original Message-----
From: Aaron Wolski [mailto:aaronjw@martekbiz.com]
Sent: Thursday, October 24, 2002 1:13 PM
To: php-db@lists.php.net
Subject: [PHP-DB] From address in mail() header not working - ideas?
Sorry for the <OFFTOPIC> post all but I am really stuck to get this
done.
I can't for the life figure this out.
I have a from header set in one piece of code that gets emailed to the
merchant. Here si the code:
$to = "$merchant_email";
$subject = "New Order on Rinkrake.com";
$long_date = date("r",time());
$headers = "Date: $long_date\r\n";
$headers .= "To: $to\r\n";
$headers .= "X-Mailer: SOME MAIL SERVER\r\n";
$headers = "Return-Path: <$support_email>\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: multipart/mixed;
boundary=\"Message-Boundary\"\r\n";
$headers .= "Content-transfer-encoding: 7BIT\r\n";
$headers .= "X-attachments: $attach_name\r\n";
$headers .= "--Message-Boundary\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "Content-transfer-encoding: 7BIT\r\n";
$headers .= "$message\r\n";
$headers .= "\n\n--Message-Boundary\r\n";
$headers .= "Content-type: $attach_type; name=\"$attach_name\"\r\n";
$headers .= "Content-Transfer-Encoding: BASE64\r\n";
$headers .= "Content-disposition: attachment;
filename=\"$attach_name\"\n\r\n";
$headers .= "$encoded_attach\r\n";
$headers .= "--Message-Boundary--\r\n";
$headers .= "From: $name <".$orderResult['email'].">\r\n";
mail($to, "$subject", "", $headers);
The above ALL works except the From header. What I get is the email
account of the web user username <username@domainname.com>
Now... I have another piece of code that I send to the customer (not the
merchant) that looks like this:
$headers = "Return-Path: <$support_email>\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: The RinkRake <$merchant_email>\r\n";
mail ($orderResult["email"],"Your Order on Rinkrake.com", $message,
$headers);
This piece of code comes through with NO "from" problems. Its formatted
as it should be.
Does anyone have any thoughts?
Are there only so many headers I can use which is why it doesn't come
through in the first one?
Thanks all.
Aaron