Re: [PHP-DB] mail() - Return-Path
Malcolm, Thank you for all this info. Let's take it one step at a time:- > 1. Message sends. =yes, answers 1 and 4 highlight the problem with email (not just email from PHP!) - there are no guarantees... (except that the developer will suffer severe headaches and recurring nightmares) > 2/3. The code used is as per the annotated on line PHP manual > > [EMAIL PROTECTED] > 11-Jan-2002 02:10 > > There used to be a note with a complete set of headers to use with the mail > function but somehow now its gone so here they are again hope it helps :) > > $headers .= "From: Name<[EMAIL PROTECTED]>\n"; > $headers .= "X-Sender: <[EMAIL PROTECTED]>\n"; > $headers .= "X-Mailer: PHP\n"; //mailer > $headers .= "X-Priority: 3\n"; //1 UrgentMessage, 3 Normal > $headers .= "Return-Path: <[EMAIL PROTECTED]>\n"; > //Uncomment this to send html format > //$headers .= "Content-Type: text/html; charset=iso-8859-1\n"; > //$headers .= "cc: [EMAIL PROTECTED]\n"; // CC to > //$headers .= "bcc: [EMAIL PROTECTED]"; // BCCs to, separete > multiple with commas [EMAIL PROTECTED], [EMAIL PROTECTED] > > Regards > P.A. Luis Tena O. > Mexico city. =I struggled hard and long with this one too - even more so for us Windows users who have to worry about \n or \r\n... The bottom line is that the PHP-native email() function is very exacting/narrowly defined - and I couldn't get it to accept my code reliably (and there's nothing wrong with MY code so it must have been ... fault !?) > 4. No error messages. An email constructed as above sends perfectly - but > the return path defaults to the apache user (in my case www) not the > supplied return path. I tested the header construction by changing > Return-Path: to X-Path: and the X-Path: header appears correctly. I am not > sure but it seams that the real Return-Path is not overidable. =yes I found this too, but no I couldn't figure it out. =So let's try to be constructive: have you read the various RFCs (depending upon which formats of email... there are several to cope with)? RFC822 is the most basic/easiest for me to understand and covers simple-text email msgs (in particular the various headers). =This raises the question about the use/implementation of Return-Path vs From. If you remove the Return-Path header completely and succeed in send/receiving a msg, what happens when you hit Reply to that msg - does it give you the from address or does the (useless) Return-Path address interject? =Assuming that works ok, then the question becomes: do you really need to worry about Return-Path at all? If you do not control the Return-Path, you may want to ascertain the server admin's policy/procedure for dealing with any (your) 'returned mail'. =If you do need to get clever with the headers then be advised that my path to success ran through phpguru.org and a set of open source email PHP classes available there for download ('the man', Richard Heyes (?sp) is often here on the list steering us through email headaches). Even though I'm not into classes/OO-programming, several examples are provided and were enough to get me started - although much of the rationale is pure gobbledegook unless you've read the RFCs (nag, nag). =Sorry I didn't spot anything blindingly obvious. Let me know how you get on. =Regards, =dn > >> I Have been trying to change the Return-Path: when using mail() but to no > >> success. I have followed the examples in the documentation. Is there any > >> hidden trick - Iam using apache 1.3.14, php 4.1.1 and sendmail 8.9.3. > > > > > >=There's been some grouching on the lists about spam and vague questions - > How much detail have you given about > >this problem? Would it be acceptable to answer saying "Iam using apache > 1.3.14, php 4.1.1 and sendmail 8.9.3. > >and it works fine"? > > > >=Fortunately I don't (use sendmail) so after grumbling away, let me say > that I do have systems that email > >(successfully) from PHP code and am interested in the topic (and did like > your precise subject line). > > > >1 if a msg is constructed (without Return-Path) does it send/receive to spec? > >2 which example/documentation? > >3 what is the pertinent PHP code? > >4 what is the errmsg-received/other symptoms? > > > >=dn > > > > > > > >-- > >PHP Database Mailing List (http://www.php.net/) > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > >To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] mail() - Return-Path
on 1/12/02 7:36 AM, Malcolm White at [EMAIL PROTECTED] appended the following bits to my mbox: > 4. No error messages. An email constructed as above sends perfectly - but > the return path defaults to the apache user (in my case www) not the > supplied return path. I tested the header construction by changing > Return-Path: to X-Path: and the X-Path: header appears correctly. I am not > sure but it seams that the real Return-Path is not overidable. It's a sendmail config thing. Do you have access to the server? Or is at a web host? If you can get access to your php.ini file and restart apache, you can change the sendmail path to: sendmail -t -i -f [EMAIL PROTECTED] That bounces all mail to that address. I believe that in PHP 4.0.6 they added another parameter of the mail function that lets you add options to sendmail from each script, but check the docs. HTH. Paul BTW, since your original message wasn't about databases and PHP, it should've gone to PHP-General. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] mail() - Return-Path
1. Message sends. 2/3. The code used is as per the annotated on line PHP manual [EMAIL PROTECTED] 11-Jan-2002 02:10 There used to be a note with a complete set of headers to use with the mail function but somehow now its gone so here they are again hope it helps :) $headers .= "From: Name<[EMAIL PROTECTED]>\n"; $headers .= "X-Sender: <[EMAIL PROTECTED]>\n"; $headers .= "X-Mailer: PHP\n"; //mailer $headers .= "X-Priority: 3\n"; //1 UrgentMessage, 3 Normal $headers .= "Return-Path: <[EMAIL PROTECTED]>\n"; //Uncomment this to send html format //$headers .= "Content-Type: text/html; charset=iso-8859-1\n"; //$headers .= "cc: [EMAIL PROTECTED]\n"; // CC to //$headers .= "bcc: [EMAIL PROTECTED]"; // BCCs to, separete multiple with commas [EMAIL PROTECTED], [EMAIL PROTECTED] Regards P.A. Luis Tena O. Mexico city. 4. No error messages. An email constructed as above sends perfectly - but the return path defaults to the apache user (in my case www) not the supplied return path. I tested the header construction by changing Return-Path: to X-Path: and the X-Path: header appears correctly. I am not sure but it seams that the real Return-Path is not overidable. I hope this is clearer. Malcolm At 12:06 12/01/2002 -, you wrote: >Malcolm, > >> I Have been trying to change the Return-Path: when using mail() but to no >> success. I have followed the examples in the documentation. Is there any >> hidden trick - Iam using apache 1.3.14, php 4.1.1 and sendmail 8.9.3. > > >=There's been some grouching on the lists about spam and vague questions - How much detail have you given about >this problem? Would it be acceptable to answer saying "Iam using apache 1.3.14, php 4.1.1 and sendmail 8.9.3. >and it works fine"? > >=Fortunately I don't (use sendmail) so after grumbling away, let me say that I do have systems that email >(successfully) from PHP code and am interested in the topic (and did like your precise subject line). > >1 if a msg is constructed (without Return-Path) does it send/receive to spec? >2 which example/documentation? >3 what is the pertinent PHP code? >4 what is the errmsg-received/other symptoms? > >=dn > > > >-- >PHP Database Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] mail() - Return-Path
Malcolm, > I Have been trying to change the Return-Path: when using mail() but to no > success. I have followed the examples in the documentation. Is there any > hidden trick - Iam using apache 1.3.14, php 4.1.1 and sendmail 8.9.3. =There's been some grouching on the lists about spam and vague questions - How much detail have you given about this problem? Would it be acceptable to answer saying "Iam using apache 1.3.14, php 4.1.1 and sendmail 8.9.3. and it works fine"? =Fortunately I don't (use sendmail) so after grumbling away, let me say that I do have systems that email (successfully) from PHP code and am interested in the topic (and did like your precise subject line). 1 if a msg is constructed (without Return-Path) does it send/receive to spec? 2 which example/documentation? 3 what is the pertinent PHP code? 4 what is the errmsg-received/other symptoms? =dn -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]