473,375 Members | 1,565 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,375 software developers and data experts.

how do you force Return-Path: variable in mail()?

I am sending email using the mail() function on a hosted account. I am
trying to override the RETURN-PATH variable but it is not working. The
server keeps overriding the variable I put in.

Here's what I have:
.....
$headers = "From: me <me@mine.com>\r\n"
$headers .= "Return-Path: me <me@mine.com>\r\n";
.....

When I send one to myself and display full headers, it shows my
us****@myserver.com as the Return-Path. Obviously, this is not good.

Any ideas?


Jul 17 '05 #1
7 12323
"NotGiven" a écrit le 04/01/2004 :
I am sending email using the mail() function on a hosted account. I am
trying to override the RETURN-PATH variable but it is not working. The
server keeps overriding the variable I put in.

Here's what I have:
....
$headers = "From: me <me@mine.com>\r\n"
$headers .= "Return-Path: me <me@mine.com>\r\n";
....

When I send one to myself and display full headers, it shows my
us****@myserver.com as the Return-Path. Obviously, this is not good.

Any ideas?


Maybe your hosting always overwrite the Return-Path:

--
Have you read the manual?
http://www.php.net/manual/en/

Jul 17 '05 #2
"NotGiven" <no****@nonegiven.net> wrote in message
news:8I*******************@bignews1.bellsouth.net. ..
I am sending email using the mail() function on a hosted account. I am
trying to override the RETURN-PATH variable but it is not working. The
server keeps overriding the variable I put in.

Here's what I have:
....
$headers = "From: me <me@mine.com>\r\n"
$headers .= "Return-Path: me <me@mine.com>\r\n";
....

When I send one to myself and display full headers, it shows my
us****@myserver.com as the Return-Path. Obviously, this is not good.

Any ideas?


look at
http://www.gzentools.com/snippetview...send-email.php

notice the -f in the 5th parameter of mail()

--
Mike Bradley
http://gzen.myhq.info -- free online php tools
Jul 17 '05 #3
That worked great. Thanks!

"CountScubula" <me@scantek.hotmail.com> wrote in message
news:ov*****************@newssvr25.news.prodigy.co m...
"NotGiven" <no****@nonegiven.net> wrote in message
news:8I*******************@bignews1.bellsouth.net. ..
I am sending email using the mail() function on a hosted account. I am
trying to override the RETURN-PATH variable but it is not working. The
server keeps overriding the variable I put in.

Here's what I have:
....
$headers = "From: me <me@mine.com>\r\n"
$headers .= "Return-Path: me <me@mine.com>\r\n";
....

When I send one to myself and display full headers, it shows my
us****@myserver.com as the Return-Path. Obviously, this is not good.

Any ideas?


look at
http://www.gzentools.com/snippetview...send-email.php

notice the -f in the 5th parameter of mail()

--
Mike Bradley
http://gzen.myhq.info -- free online php tools

Jul 17 '05 #4
Mike:

I like your site and your mailer script. Thanks again for your help. I
have another question I posted to the group b4 I realized that site was your
site.

I still see my userID in the parameter as shown here seen in my full headers
of my email sent.

Received: (from userID@localhost) by mydomain.com

Any ideas?

Also, what does the section in the header, "X-Mailer: my php script\n" do?

thanks!
"CountScubula" <me@scantek.hotmail.com> wrote in message
news:ov*****************@newssvr25.news.prodigy.co m...
"NotGiven" <no****@nonegiven.net> wrote in message
news:8I*******************@bignews1.bellsouth.net. ..
I am sending email using the mail() function on a hosted account. I am
trying to override the RETURN-PATH variable but it is not working. The
server keeps overriding the variable I put in.

Here's what I have:
....
$headers = "From: me <me@mine.com>\r\n"
$headers .= "Return-Path: me <me@mine.com>\r\n";
....

When I send one to myself and display full headers, it shows my
us****@myserver.com as the Return-Path. Obviously, this is not good.

Any ideas?


look at
http://www.gzentools.com/snippetview...send-email.php

notice the -f in the 5th parameter of mail()

--
Mike Bradley
http://gzen.myhq.info -- free online php tools

Jul 17 '05 #5
> Mike:

I like your site and your mailer script. Thanks again for your help. I
have another question I posted to the group b4 I realized that site was your site.
Thank you, and you are welcome.

I still see my userID in the parameter as shown here seen in my full headers of my email sent.

Received: (from userID@localhost) by mydomain.com
This is becouse it is looking at whom is passing the mail to sendmail, it is
usualy the user that apache is running as.

Also, what does the section in the header, "X-Mailer: my php script\n" do?

X-headers, are generaly FYI types of information, they are not in the RFC's
(internet drafts of protocols)
They are not required, and anyone can put anything they want.

you could even add:
X-Web-From: mysite.com


thanks!


Your welcome :)

--
Mike Bradley
http://gzen.myhq.info -- free online php tools
"NotGiven" <no****@nonegiven.net> wrote in message
news:43*****************@bignews6.bellsouth.net...
Jul 17 '05 #6
On Sun, 04 Jan 2004 15:33:50 -0500, NotGiven wrote:
I am sending email using the mail() function on a hosted account. I am
trying to override the RETURN-PATH variable but it is not working. The
server keeps overriding the variable I put in.

Here's what I have:
....
$headers = "From: me <me@mine.com>\r\n" $headers .= "Return-Path: me
<me@mine.com>\r\n"; ....

When I send one to myself and display full headers, it shows my
us****@myserver.com as the Return-Path. Obviously, this is not good.

Any ideas?

This has to be done in the Web server config:
php_admin_value sendmail_path "/usr/sbin/sendmail -oi -t -f yo*@foo.com"
etc etc.
HTH =)

Regards,

Ian

--
Ian.H [Design & Development]
digiServ Network - Web solutions
www.digiserv.net | irc.digiserv.net | forum.digiserv.net
Programming, Web design, development & hosting.

Jul 17 '05 #7
"NotGiven" <no****@nonegiven.net> wrote in message
news:43*****************@bignews6.bellsouth.net...
Mike:

I like your site and your mailer script. Thanks again for your help. I
have another question I posted to the group b4 I realized that site was your site.

I still see my userID in the parameter as shown here seen in my full headers of my email sent.

Received: (from userID@localhost) by mydomain.com


This will do it:

http://www.gzentools.com/snippetview...l&v=mxmail.php

--
Mike Bradley
http://www.gzentools.com -- free online php tools
Jul 17 '05 #8

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

Similar topics

0
by: jacob c. | last post by:
When I request a URL using urllib2, it appears that urllib2 always makes the request using HTTP 1.0, and not HTTP 1.1. I'm trying to use the "If-None-Match"/"ETag" HTTP headers to conserve...
17
by: Will Stuyvesant | last post by:
Here is a question for people who are more comfortable than I am with new Python stuff like generators. I am having fun implementing things from the Wizard book (Abelson, Sussman, "Structure and...
2
by: Konstantin Zakharenko | last post by:
Hello, Our QA team have running a lot of test scripts (for automated regression testing), they run them on the different databases (Oracle/MS SQL). Several of those tests are dependent on the...
2
by: Jonathan Driller | last post by:
I am attempting to block repeat downloads from a site. I need to have a landing page pass a referer to a secured page. I have tried a meta refresh redirect and several Javascript redirect...
8
by: Steven | last post by:
i need to force a carriage return with a textarea field at X number of characters. anybody know how to do this? tks
0
by: miller chen | last post by:
Using WebServices, and server add the new class PersonSet that inherite DataSet,follow down: public class PersonSet:DataSet { private string _strB; public string strB { get
5
by: annagel | last post by:
I am looking for a way to force a Tkinter window into focus on a system level. I know the force focus method should bring one window of my application into focus, but it seems I need to have some...
11
by: ago | last post by:
Inspired by some recent readings on LinuxJournal and an ASPN recipe, I decided to revamp my old python hack... The new code is a combination of (2) reduction methods and brute force and it is quite...
0
by: jinnareddy | last post by:
Hi, I'm unable to download a file that is having a 2-byte char in its name (e.g.テ) using force download option. Though, am able to download file names involving ASCII chars. I have tried URL...
1
by: Przemyslaw Koprowski | last post by:
Hi all, Imagine you have a class, containing two methods with the same name (say 'get'), but one being an inspector the other mutator - the class contains a kind of data structure (vector in...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.