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
Need help making a blockquote and line items conditional
I have some code I bought a few years ago that allows my clients to update content on their site using an Excel spreadsheet. Well this particular application sometimes has line items so I need to come
str_replace help
Hey there,I'm a PHP newb, I'm having troubles with the str_replace function. I want to clean up bad html to valid xhtml, I am using:Code: $pee = str_replace('&', '&amp;', $pee);It
ImageCreate()
When I create an image and add text to it I want my text to be replaced with a PNG image, because the PNG image has text effects. I have an image of every letter I just don't know if this is possible
Php WordPress help
I am writing the following code for making a plugin<?phpheader("Content-Type: text/css");/*Plugin Name: Name of the plugin.Plugin URI: The page having information related to
Header redirect
Hello ive got a problem ive got form with its action set to itself.Code: <form id="formID" class="formular" method="post" action=""/>it then runs
Executing an exe
Hi. I have some bizarre problem with exec (other any other method) to launch exe's. I am making a game server booking system and the part that is not working is the one with the launching the server
OOP help
okay so i have a class im making it has everything setup i just need to randomize the 2 variables and return which variable that was randomized and output it.Code: <?phpclass hit_chance {
Using real time in php
I'm very average at PHP and im looking to introduce time to something on my site.Its a sports site and everyone has fixtures. I have them so they are created and put into a table, what I now want to
Save file by click
Hello. I'm not understand how to save file from page. I'd like make link to file with save ability.<?phpchdir('upload/');foreach (glob("*.*") as $filename) { $uploadfile =
Get ID from Database when Posting with a HTML Form
I have a form I am submitting to a MySql database. Each product has an ID # attached to it that auto_increment.I need to pull the auto incremented ID # for the entry I just posted onto the page so the