473,395 Members | 1,956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

mail function has FROM changed by server?

Hi,

I am running a simple mail function, and I want to set the FROM header
within the function:

mail(
"ma*****@provider.com",
"testsubject",
"testbody",
"From: Oliver <ol****@mydomain.com>
X-Sender: <ol****@mydomain.com>
X-Mailer: Test Script
Return-Path: <ol****@mydomain.com>
Content-Type: text/plain; charset=iso-8859-1"
);

However, form my phpinfo I can see that the from_header is:

FROM_HEADER provider.com

Now, all outgoing emails are changed in the header:

From: Oliver <ol****@provider.com>

(!)

How can I prevent this?

thanks

Oliver

Jul 16 '05 #1
1 1861
Hello,

On 07/23/2003 10:26 AM, Oliver Spiesshofer wrote:
I am running a simple mail function, and I want to set the FROM header
within the function:

mail(
"ma*****@provider.com",
"testsubject",
"testbody",
"From: Oliver <ol****@mydomain.com>
X-Sender: <ol****@mydomain.com>
X-Mailer: Test Script
Return-Path: <ol****@mydomain.com>
Content-Type: text/plain; charset=iso-8859-1"
);

However, form my phpinfo I can see that the from_header is:

FROM_HEADER provider.com

Now, all outgoing emails are changed in the header:

From: Oliver <ol****@provider.com>

(!)

How can I prevent this?


I think you are confusing the From: header with the From header. They
are not the same thing. The former is what you set in your messages and
the later may be set by the MTA to denote the real envelope sender which
is also where bounced messages will eventually return.

To set the envelope sender it depends on the MTA that is used. You may
want to try this class that abstracts the envelope sender address taking
it from the Return-Path: header. See the examples to learn how to do it:

http://www.phpclasses.org/mimemessage

--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

Jul 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: tzuccolo2001 | last post by:
I'm trying to send an email using the mail() function. I've carefully made use of the ini_set(SMTP, "mail.my.server") function to set my SMTP server and also to set my From: address. I'm still...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
1
by: apasj06 | last post by:
hello everyone: I am trying to send email via php. I using window XP home edition. My mail client is outlook express. I configured mail client to send email via my aol email account. mail...
2
by: Tim Ferguson | last post by:
Dear all I have a script (below) that for a long time has been sending out to an opt-in distribution list, about 100 members. Today it has stopped working and I am not quite sure what I have...
2
by: Spartacus | last post by:
Hello, I know there is lots of information out there and I've taken a look, but I want to learn how to do this myself. And I'm a beginner here and some of it I don't understand (so no flames,...
4
by: mmr315 | last post by:
Warning: mail() : Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\Apache2.2\htdocs\mail.php on line 7 i...
1
by: maxxxxel | last post by:
Hi Can anyone help me with some asp code , I changed the code to use CDO.message instead of the old cdont.sys to send mail from a ASP webpage which works fine. Our problem is that when we send...
2
by: Dave | last post by:
Hi, I hope someone can help, I'm trying to get mail out from a form to a php page using the mail() function. Nothing happens. The server is W2003 and the mail application is Kerio Mailserver, not...
4
borisding
by: borisding | last post by:
Hi there, Well, I really need help from someone here, and hope that someone will answer my question and solve my problem. I know it's very common question and being asked by many developers: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.