Re: [PHP] Mail reply-path

2006-08-16 Thread bob pilly
Hi Richard this is exactly what i was after and works perfectly! 

Cheers

Bob

Richard Lynch [EMAIL PROTECTED] wrote: On Tue, August 15, 2006 6:54 am, bob 
pilly wrote:
 Im trying to send emails using the mail() function but im having a
 problem. Because the box that the scripts sit on is a shared
 web-hosting package the Reply-path part of the header always comes up
 as [EMAIL PROTECTED] but i have set the from part of the
 header to [EMAIL PROTECTED] A lot of people are not getting the
 emails (most are) and im picking that its because the domains on the 2
 header parts are different and they have some sort of antispam policy
 which blocks these. Apart from changing the domains or email addresses
 to be the same has anyone seen this problem before and if so can you
 give advice or point me to some relevant docs on it? I have tried to
 change the Replay-path: part of the header with code but it seems to
 default to the above.

The Reply-path: you want to change is not a normal header, so you can
cross off the idea of fixing it with the 4th arg to mail().

If you are using current PHP, there is yet another bonus argument, the
5th one, for this specific purpose, documented in the manual:
http://php.net/mail

If you are NOT using a version of PHP that has that 5th arg, then you
could maybe use ini_set on the sendmail_path to add the -f there. (see
man mail).

That, however, would require that the user PHP runs as, which is what
Apache runs as, be a trusted user in sendmail.cf, which your webhost
may or may not have decided is a Good Idea, based on how much they
trust their clients.

Going farther afield, you could attempt to find an SMTP
host/server/setup that would allow you to set these values to what you
want -- I *think* that's do-able...  I never had to go that far,
personally, so can't be certain.

You may also want to convince the recipients to white-list your
address, so that the From/Reply-path/etc are all irrelevant for spam
filtering.  This has the advantage of being a long-term solution, for
any reasonable implementation of spam-filtering that allows
whitelisting by the recipient, no matter what spam-filtering rules
are brought to bear in the future.

-- 
Like Music?
http://l-i-e.com/artists.htm





-
 All new Yahoo! Mail The new Interface is stunning in its simplicity and ease 
of use. - PC Magazine

[PHP] Mail reply-path

2006-08-15 Thread bob pilly
Hi all

Im trying to send emails using the mail() function but im having a problem. 
Because the box that the scripts sit on is a shared web-hosting package the 
Reply-path part of the header always comes up as [EMAIL PROTECTED] but i have 
set the from part of the header to [EMAIL PROTECTED] A lot of people are not 
getting the emails (most are) and im picking that its because the domains on 
the 2 header parts are different and they have some sort of antispam policy 
which blocks these. Apart from changing the domains or email addresses to be 
the same has anyone seen this problem before and if so can you give advice or 
point me to some relevant docs on it? I have tried to change the Replay-path: 
part of the header with code but it seems to default to the above.

Thanks in advance for any help!!

Cheers

Bob


-
 Try the all-new Yahoo! Mail . The New Version is radically easier to use – 
The Wall Street Journal

Re: [PHP] Mail reply-path

2006-08-15 Thread Jon Anderson

bob pilly wrote:

Im trying to send emails using the mail() function but im having a problem. 
Because the box that the scripts sit on is a shared web-hosting package the 
Reply-path part of the header always comes up as [EMAIL PROTECTED] but i have 
set the from part of the header to [EMAIL PROTECTED] A lot of people are not 
getting the emails (most are) and im picking that its because the domains on 
the 2 header parts are different and they have some sort of antispam policy 
which blocks these. Apart from changing the domains or email addresses to be 
the same has anyone seen this problem before and if so can you give advice or 
point me to some relevant docs on it? I have tried to change the Replay-path: 
part of the header with code but it seems to default to the above.
I think you're looking for the 'Return-Path' header rather than the 
reply-path. (Or perhaps even Reply-To?)


Try something like this:

$from = 'A User [EMAIL PROTECTED]';
$eol = \r\n; /* or sometimes \n */
$headers  = Return-Path: $from$eol;
$headers .= From: $from$eol;

mail($to,$subject,$message,$headers);

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Mail reply-path

2006-08-15 Thread Richard Lynch
On Tue, August 15, 2006 6:54 am, bob pilly wrote:
 Im trying to send emails using the mail() function but im having a
 problem. Because the box that the scripts sit on is a shared
 web-hosting package the Reply-path part of the header always comes up
 as [EMAIL PROTECTED] but i have set the from part of the
 header to [EMAIL PROTECTED] A lot of people are not getting the
 emails (most are) and im picking that its because the domains on the 2
 header parts are different and they have some sort of antispam policy
 which blocks these. Apart from changing the domains or email addresses
 to be the same has anyone seen this problem before and if so can you
 give advice or point me to some relevant docs on it? I have tried to
 change the Replay-path: part of the header with code but it seems to
 default to the above.

The Reply-path: you want to change is not a normal header, so you can
cross off the idea of fixing it with the 4th arg to mail().

If you are using current PHP, there is yet another bonus argument, the
5th one, for this specific purpose, documented in the manual:
http://php.net/mail

If you are NOT using a version of PHP that has that 5th arg, then you
could maybe use ini_set on the sendmail_path to add the -f there. (see
man mail).

That, however, would require that the user PHP runs as, which is what
Apache runs as, be a trusted user in sendmail.cf, which your webhost
may or may not have decided is a Good Idea, based on how much they
trust their clients.

Going farther afield, you could attempt to find an SMTP
host/server/setup that would allow you to set these values to what you
want -- I *think* that's do-able...  I never had to go that far,
personally, so can't be certain.

You may also want to convince the recipients to white-list your
address, so that the From/Reply-path/etc are all irrelevant for spam
filtering.  This has the advantage of being a long-term solution, for
any reasonable implementation of spam-filtering that allows
whitelisting by the recipient, no matter what spam-filtering rules
are brought to bear in the future.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Mail reply-path

2006-08-15 Thread tedd

At 11:06 AM -0400 8/15/06, Jon Anderson wrote:

bob pilly wrote:
Im trying to send emails using the mail() function but im having a 
problem. Because the box that the scripts sit on is a shared 
web-hosting package the Reply-path part of the header always comes 
up as [EMAIL PROTECTED] but i have set the from part of the 
header to [EMAIL PROTECTED] A lot of people are not getting 
the emails (most are) and im picking that its because the domains 
on the 2 header parts are different and they have some sort of 
antispam policy which blocks these. Apart from changing the domains 
or email addresses to be the same has anyone seen this problem 
before and if so can you give advice or point me to some relevant 
docs on it? I have tried to change the Replay-path: part of the 
header with code but it seems to default to the above.
I think you're looking for the 'Return-Path' header rather than the 
reply-path. (Or perhaps even Reply-To?)




This works for me (use your own name and domain):  :-)

$to = [EMAIL PROTECTED];
$re = Subject;
$msg = Message\n;
$headers = Return-path: [EMAIL PROTECTED]\r\n;
$headers .= From: tedd [EMAIL PROTECTED]\r\n;
$param5 = '-ftedd@' . $_SERVER['SERVER_NAME'];
mail ($to, $re, $msg, $headers, $param5);

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Mail reply-path

2006-08-15 Thread Chris

Richard Lynch wrote:

On Tue, August 15, 2006 6:54 am, bob pilly wrote:

Im trying to send emails using the mail() function but im having a
problem. Because the box that the scripts sit on is a shared
web-hosting package the Reply-path part of the header always comes up
as [EMAIL PROTECTED] but i have set the from part of the
header to [EMAIL PROTECTED] A lot of people are not getting the
emails (most are) and im picking that its because the domains on the 2
header parts are different and they have some sort of antispam policy
which blocks these. Apart from changing the domains or email addresses
to be the same has anyone seen this problem before and if so can you
give advice or point me to some relevant docs on it? I have tried to
change the Replay-path: part of the header with code but it seems to
default to the above.


The Reply-path: you want to change is not a normal header, so you can
cross off the idea of fixing it with the 4th arg to mail().

If you are using current PHP, there is yet another bonus argument, the
5th one, for this specific purpose, documented in the manual:
http://php.net/mail

If you are NOT using a version of PHP that has that 5th arg, then you
could maybe use ini_set on the sendmail_path to add the -f there. (see
man mail).

That, however, would require that the user PHP runs as, which is what
Apache runs as, be a trusted user in sendmail.cf, which your webhost
may or may not have decided is a Good Idea, based on how much they
trust their clients.


and also safe_mode being off. Not sure why safe_mode affects this (ask 
the powers that be) but it does.


--
Postgresql  php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php