I have a question about setting email headers when using mail() in a php script.
When I send an email from an email account set up domain (using, for example, xxx@MyDomain.net) and then view the header in the email that was received by the recipient account, the "Received:" header reads, in part, as follows:
QuoteReceived: from localhost ([xxx.x.x.x] helo=www.MyDomain.net)
by servername.host.com with esmtpa (Exim 4.69)
(envelope-from <xxx@MyDomain.net>)
id xxxxx-xxxxxxx-xx
However, when I send an email using a script that I am working on that uses the mail() function, I set the "From:" and "Return-path" to an email address I have for my domain (YYY@MyDomain.net). When I look at the header in the email that was received by the recipient account, the "Received:" header has my CPanel user name in it - and that kind of makes me nervous (as my host preaches not to disclose that to anyone). In particular, here is what the "Received:" header looks like:
QuoteReceived: from cPanelUserName by servername.host.com with local (Exim 4.69)
(envelope-from YYY@MyDomain.net)
id xxxxx-xxxxxxx-xx; Sat, 21 Nov 2009 21:36:09 -0500
Here is the code snippet I am using to send email and set headers:
Code: //Some additional email headers
$add_headers = 'From: YYY@MyDomain.net' . "rn". "Return-path: YYY@MyDomain.net" . "rn";
mail('XXX@MyDomain.net', $subject , $message , $add_headers, "-f YYY@MyDomain.net");
I have tried to modify the "Received:" header by adding some text to the header via the mail() function (for example, "Received: SOME TEST]"), but it doesn't change the "Received:" header.
Please note, I don't want to make the header fraudulent, but I would prefer not to disclose my cPanel username. I would just like the "Received:" header to resemble the first one quoted above.
I have checked with my host's help desk, they suggested it was not a server issue, but a scripting issue. They suggested I try their scripting forum for assistance. I posted there, but no one there has shed any light on this yet. So, I thought that I would try here.
I tried researching this on the Internet, and thus far I have not found any info on how to successfully modify "Received:" header with mail(). Info I have come across seems to suggest that this is a server issue and not something that can be changed via a script (at least via a script using mail()). If that is the case, I am thinking I should stop looking for a solution using mail(), and take a different approach.
Any suggestions?
Thanks
Windows Authentication
I have a website which is windows authenticated.now i want something more on this application.I want to add login as different user link which will open the login form to authenticate other user
modifying a property of an object from a different class
I have 2 classes:- Math- Distancein my math class, I have this line:$distance = new Distance($this->query, $this->distances);and this property:public $special = array();in my Distance
Strange Oracle Query problem
Ok So I have this PHP class that talks to a Javascript class that basically creates a table of information from a database query and puts it in a sortable, filterable table. This all works fine and
MII Netweaver Server stopped due to CPIC connection Problem
Dear Experts,
Format String help
I have a textbox where a person enters an application number. the application number is 10 characters in length:ex: 000012345A0256775434My clients only want to enter in the numbers without the
Putting double spaces instead of single spaces
Im looking at trying to replace all single spacing between fields with double spacingAt present my file looks like this 3 Caxxxan Maxxxet Waxxxxe Axxxxxxy Co.Kildare but after the double spacing, I
SAP Logon Failed
I tried to login to SAP through MMC.
Ball movement
I want to move a ball from one point to another and it should hit a group of balls at the other end and scatter them.Could You kindly explain with sample code?
check_changed_data - I can't get data from the called method event
I use check_changed_data to trigger my event method.
php or sql?
Sorry not sure if this is a sql problem or php the following code is supposed to delete data from the sql. However when I click delete nothing happens.Code: