473,499 Members | 1,691 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 12337
"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
2631
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
2437
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
8716
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
12617
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
46126
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
1469
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
7771
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
4120
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
2648
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
1981
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...
0
7014
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7229
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...
1
6905
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
4921
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4609
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3108
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3103
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1429
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
667
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.