469,271 Members | 1,743 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,271 developers. It's quick & easy.

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 12121
"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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by jacob c. | last post: by
17 posts views Thread by Will Stuyvesant | last post: by
2 posts views Thread by Jonathan Driller | last post: by
8 posts views Thread by Steven | last post: by
5 posts views Thread by annagel | last post: by
11 posts views Thread by ago | last post: by
1 post views Thread by Przemyslaw Koprowski | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.