Forum Moderators: coopster
$from .= "From: $someemail\n";
$from .= "X-Sender: $someemail\n";
$from .= "X-Mailer: PHP\n";
$from .= "X-Priority: 3\n";
$from .= "Return-Path: $someemail\n";
$from .= "Reply-To: $siteemail\n";
mail($to,$subject,$message,$from);
I also have gotten into the habit of putting hard returns in messages for another problem I found. So far it has done very well across many, many servers.
I hate email
That single header helped a few out, I have no clue why it would matter but it seems to.
have you looked at the mail headers when you receive it to see if there is any extra info in there? What type of server is it?
>> have you looked at the mail headers when you receive it to see if there is any extra info in there? What type of server is it?
This is the raw view:
X-From_: root@website.com Tue Oct 21 01:47:11 2003
Return-Path: <root@website.com>
Received: from website.com (website.com [xx.xx.xx.xxx])
by mybiz.mailserver.com (8.12.10/8.12.9) with ESMTP id h9L5lAC4046014
for <myemail@mydomain.com>; Tue, 21 Oct 2003 01:47:11 -0400 (EDT)
Received: (from root@localhost)
by website.com (8.11.6/8.11.6) id h9L5lAV05608;
Mon, 20 Oct 2003 23:47:10 -0600
Date: Mon, 20 Oct 2003 23:47:10 -0600
From: Root User <root@website.com>
Message-Id: <200310210547.h9L5lAV05608@website.com>
To: client@website.com
Subject: Need Info Request
Message
From: sales@website.com
X-Sender: sales@website.com
X-Mailer: PHP
X-Priority: 3
Reply-To: sales@website.com
It's a linux box with an Apache server using SendMail. It's not a big deal at this moment who it comes from since the email does get sent and is received by the client. Though I would like to understand why it chooses Root User and what I could do to change if I wanted to.
is php running as root? usually everything is set as nobody and you get really strange return paths but I have had them throw root in there once in a while.
shared hosts cause all kinds of messes when it comes to email, I have found that header list to be the most reliable, also make sure you put hard returns in the message. If you are on your own server you can mess around a lot more. Take a look at sendmail settings or even apache. On a windows server it uses the sendmail_from in php.ini, I have noticed that address, if set, often matches the default even on *nix.
I hate email more all the time