Re: [PHP] mail from
in my php.ini, I have this set sendmail_from = [EMAIL PROTECTED] yet when I do this command :([EMAIL PROTECTED],TEST MAIL,TESTING MAIL); I get this message Warning: mail() [function.mail]: sendmail_from not set in php.ini or custom From: header missing in C:\Inetpub\wwwroot\intranet\test.php on line 4 And if instead of using the php.ini directive you use the fourth argument to mail()? Eg: ?php mail([EMAIL PROTECTED], TEST MAIL, TESTING MAIL, '[EMAIL PROTECTED]'); ? -- Richard Heyes +44 (0)800 0213 172 http://www.websupportsolutions.co.uk Knowledge Base and HelpDesk software that can cut the cost of online support -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail from
Richard Heyes wrote: in my php.ini, I have this set sendmail_from = [EMAIL PROTECTED] yet when I do this command :([EMAIL PROTECTED],TEST MAIL,TESTING MAIL); I get this message Warning: mail() [function.mail]: sendmail_from not set in php.ini or custom From: header missing in C:\Inetpub\wwwroot\intranet\test.php on line 4 And if instead of using the php.ini directive you use the fourth argument to mail()? Eg: ?php mail([EMAIL PROTECTED], TEST MAIL, TESTING MAIL, '[EMAIL PROTECTED]'); ? Oops. That should be: ?php mail([EMAIL PROTECTED], TEST MAIL, TESTING MAIL, 'From: [EMAIL PROTECTED]'); ? -- Richard Heyes +44 (0)800 0213 172 http://www.websupportsolutions.co.uk Knowledge Base and HelpDesk software that can cut the cost of online support -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail from
On 10/25/07, Richard Heyes [EMAIL PROTECTED] wrote: Richard Heyes wrote: in my php.ini, I have this set sendmail_from = [EMAIL PROTECTED] yet when I do this command :([EMAIL PROTECTED],TEST MAIL,TESTING MAIL); I get this message Warning: mail() [function.mail]: sendmail_from not set in php.ini or custom From: header missing in C:\Inetpub\wwwroot\intranet\test.php on line 4 And if instead of using the php.ini directive you use the fourth argument to mail()? Eg: ?php mail([EMAIL PROTECTED], TEST MAIL, TESTING MAIL, '[EMAIL PROTECTED]'); ? Oops. That should be: ?php mail([EMAIL PROTECTED], TEST MAIL, TESTING MAIL, 'From: [EMAIL PROTECTED]'); ? -- Richard Heyes +44 (0)800 0213 172 http://www.websupportsolutions.co.uk Knowledge Base and HelpDesk software that can cut the cost of online support -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php It sounds like you need to restart IIS to allow the changes to php.ini to take effect. -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 Give a man a fish, he'll eat for a day. Then you'll find out he was allergic and is hospitalized. See? No good deed goes unpunished -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mail from
in my php.ini, I have this set sendmail_from = [EMAIL PROTECTED] The first thing I'd do is verify if the script is really using the php.ini you think it is by having the script output phpinfo. _ Peek-a-boo FREE Tricks Treats for You! http://www.reallivemoms.com?ocid=TXT_TAGHMloc=us
Re: [PHP] mail() from addess problems
On Tue, 2004-09-07 at 16:52, Josh Close wrote: When I'm using mail() to send an email, the user is always From: Apache [EMAIL PROTECTED] How would I get this to change? I didn't see anything in php.ini or httpd.conf. I've found it's not possible to do a header rewrite with postfix either. Add a From: header in the optional last field of your mail() call. -- Greg Donald -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() from addess problems
How would I get this to change? I didn't see anything in php.ini or httpd.conf. I've found it's not possible to do a header rewrite with postfix either. There is examples in the manual http://us2.php.net/mail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() from addess problems
Thanks. -Josh On Tue, 07 Sep 2004 16:55:24 -0500, Greg Donald [EMAIL PROTECTED] wrote: On Tue, 2004-09-07 at 16:52, Josh Close wrote: When I'm using mail() to send an email, the user is always From: Apache [EMAIL PROTECTED] How would I get this to change? I didn't see anything in php.ini or httpd.conf. I've found it's not possible to do a header rewrite with postfix either. Add a From: header in the optional last field of your mail() call. -- Greg Donald -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail From option in PHP.ini
On 07/18/2003 12:00 PM, Brian S. Drexler wrote: Ok, I want to specify who the mail is coming from by using the sendmail_path option in the PHP.ini. I've added the [EMAIL PROTECTED] to it, but I want to be able to dynmaically change [EMAIL PROTECTED] to [EMAIL PROTECTED] or whatever else. Anyone have any ideas how I can do this? I'm pulling the e-mail I'd like to change it to from a MySQL database but can I rewrite the php.ini file on the fly or am I stuck. Any help is greatly appreciated. Why not just add the From: header to the fourth mail() param? Something like this: $email = [EMAIL PROTECTED]; $admin_email = [EMAIL PROTECTED]; $body = blah blah blah; $mail = mail($email, Information you requested, $body, From: $admin_email); I've found that this sets the headers the way most clients expect to see them. We use it a lot to tidy up emails set from reset your password functions and the like. It should be trivial to set the From: header based on a db result or whatever. There is a much expanded version of this solution regarding sending emails with attachments through mail() on in the online php manual, check out kieran dot huggins at rogers dot com's comments and some others on the http://us4.php.net/mail page (it's a 06-Nov-2002 comment). I'm coming in a bit late to this conversation -- hopefully I'm not too far off base with this reply. If I am, sorry! peter -- Peter Torraca Webmaster, Math Department Purdue Univ., Math 813 765-494-9998 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail From option in PHP.ini
From the php website, it appears that the [EMAIL PROTECTED] can be put in the fifth parameter of the mail() function: Example 3. Sending mail with extra headers and setting an additional command line parameter. mail([EMAIL PROTECTED], the subject, $message, From: [EMAIL PROTECTED], [EMAIL PROTECTED]); Note: This fifth parameter was added in PHP 4.0.5. Since PHP 4.2.3 this parameter is disabled in safe_mode and the mail() function will expose a warning message and return FALSE if you're trying to use it. I followed this recent thread with some interest, because I'd like to be able to set the return-path header for a script that emails to a large list, which would in turn allow me to identify bounced emails. I'm using a shared host server, with PHP running as the master account user name, so the return-path for emails is something like Return-Path: [EMAIL PROTECTED]. I had accepted that I could not change the return-path value with PHP, but reading about this fifth parameter renewed my hope that I could. I tried adding a fifth parameter to mail() in order to do this, like so: // fifth mail() parameter to set envelope sender $cmd_line_param = [EMAIL PROTECTED]; mail($fullname$email, $subject, $message, $headers, $cmd_line_param); This didn't change the return-path header. Perhaps the problem is that I have no idea what the syntax of the command line parameter is (what the -f does). Can anyone advise? Is it possible to use this fifth parameter to set the return-path header, and if so, what's the syntax? TIA, -- Lowell Allen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail From option in PHP.ini
* Thus wrote Lowell Allen ([EMAIL PROTECTED]): return-path for emails is something like Return-Path: [EMAIL PROTECTED]. I had accepted that I could not change the return-path value with PHP, but reading about this fifth parameter renewed my hope that I could. I tried adding a fifth parameter to mail() in order to do this, like so: // fifth mail() parameter to set envelope sender $cmd_line_param = [EMAIL PROTECTED]; mail($fullname$email, $subject, $message, $headers, $cmd_line_param); This didn't change the return-path header. Perhaps the problem is that I have no idea what the syntax of the command line parameter is (what the -f does). I believe its '-f [EMAIL PROTECTED]', could be different depending on wich sendmail your using. I'm curious though what if your sendmail already has a -f on it: php.ini: sendmail_path=sendmail [EMAIL PROTECTED] thus a command sendmail [EMAIL PROTECTED] [EMAIL PROTECTED] Can anyone advise? Is it possible to use this fifth parameter to set the return-path header, and if so, what's the syntax? Also, the 5th paramater is disabled in safe_mode, check that also if the above doesn't work. Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail From option in PHP.ini
Ok, I want to specify who the mail is coming from by using the sendmail_path option in the PHP.ini. I've added the [EMAIL PROTECTED] to it, but I want to be able to dynmaically change [EMAIL PROTECTED] to [EMAIL PROTECTED] or whatever else. Anyone have any ideas how I can do this? I'm pulling the e-mail I'd like to change it to from a MySQL database but can I rewrite the php.ini file on the fly or am I stuck. Any help is greatly appreciated. Why not just put it in the extra headers? $headers .= From: $email_address_from_your_database\r\n; Or you could possibly use ini_set() to change the php.ini setting. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mail From option in PHP.ini
I tried the extra header. The problem is with the return receipts. The mail is being generated by a server other than my main e-mail server, so if I want a delivery/read receipt I have to specify a From e-mail address or else it will default to the user executing the script, i.e. [EMAIL PROTECTED] ini_set() does not appear to work with sendmail_path. sendmail_path is in the PHP_INI_SYSTEM group so it can only be set in the php.ini or httpd.conf...Thanks for the suggestion though... -Original Message- From: CPT John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:09 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Mail From option in PHP.ini Ok, I want to specify who the mail is coming from by using the sendmail_path option in the PHP.ini. I've added the [EMAIL PROTECTED] to it, but I want to be able to dynmaically change [EMAIL PROTECTED] to [EMAIL PROTECTED] or whatever else. Anyone have any ideas how I can do this? I'm pulling the e-mail I'd like to change it to from a MySQL database but can I rewrite the php.ini file on the fly or am I stuck. Any help is greatly appreciated. Why not just put it in the extra headers? $headers .= From: $email_address_from_your_database\r\n; Or you could possibly use ini_set() to change the php.ini setting. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail From option in PHP.ini
the sendmail_path in php.ini is to do with where abouts the sendmail program is located, not where your sending mail from... if you define the extra headers in the mail, such as FROM and REPLY-TO, you shouldn't have any problems. basically, it's just like fake-mail, and your recipient should be none-the-wiser unless he really wants to sift through the headers. - Original Message - From: Brian S. Drexler [EMAIL PROTECTED] To: 'CPT John W. Holmes' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, July 18, 2003 4:10 PM Subject: RE: [PHP] Mail From option in PHP.ini I tried the extra header. The problem is with the return receipts. The mail is being generated by a server other than my main e-mail server, so if I want a delivery/read receipt I have to specify a From e-mail address or else it will default to the user executing the script, i.e. [EMAIL PROTECTED] ini_set() does not appear to work with sendmail_path. sendmail_path is in the PHP_INI_SYSTEM group so it can only be set in the php.ini or httpd.conf...Thanks for the suggestion though... -Original Message- From: CPT John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:09 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Mail From option in PHP.ini Ok, I want to specify who the mail is coming from by using the sendmail_path option in the PHP.ini. I've added the [EMAIL PROTECTED] to it, but I want to be able to dynmaically change [EMAIL PROTECTED] to [EMAIL PROTECTED] or whatever else. Anyone have any ideas how I can do this? I'm pulling the e-mail I'd like to change it to from a MySQL database but can I rewrite the php.ini file on the fly or am I stuck. Any help is greatly appreciated. Why not just put it in the extra headers? $headers .= From: $email_address_from_your_database\r\n; Or you could possibly use ini_set() to change the php.ini setting. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail From option in PHP.ini
... and how about this? $headers .= Return-Path: $email_address_from_your_database\r\n; tell me, if it works. ciao SVEN Brian S. Drexler wrote: I tried the extra header. The problem is with the return receipts. The mail is being generated by a server other than my main e-mail server, so if I want a delivery/read receipt I have to specify a From e-mail address or else it will default to the user executing the script, i.e. [EMAIL PROTECTED] ini_set() does not appear to work with sendmail_path. sendmail_path is in the PHP_INI_SYSTEM group so it can only be set in the php.ini or httpd.conf...Thanks for the suggestion though... -Original Message- From: CPT John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:09 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Mail From option in PHP.ini Ok, I want to specify who the mail is coming from by using the sendmail_path option in the PHP.ini. I've added the [EMAIL PROTECTED] to it, but I want to be able to dynmaically change [EMAIL PROTECTED] to [EMAIL PROTECTED] or whatever else. Anyone have any ideas how I can do this? I'm pulling the e-mail I'd like to change it to from a MySQL database but can I rewrite the php.ini file on the fly or am I stuck. Any help is greatly appreciated. Why not just put it in the extra headers? $headers .= From: $email_address_from_your_database\r\n; Or you could possibly use ini_set() to change the php.ini setting. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mail From option in PHP.ini
It's not the recipient that is the problem. The extra headers work fine for that. It's the delivery and read notifications (recipient's mail server). The From header that is generated by sendmail itself is where I'm getting the problem. If I specify the -f option in the sendmail_path it fixes the problem. Just specifying a From header works for the recipients e-mail client, but it doesn't work for their server...I also tried Content-Disposition-To, Return-Path and a few others. All unsuccessfully -Original Message- From: skate [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:16 AM To: [EMAIL PROTECTED]; 'CPT John W. Holmes'; [EMAIL PROTECTED] Subject: Re: [PHP] Mail From option in PHP.ini the sendmail_path in php.ini is to do with where abouts the sendmail program is located, not where your sending mail from... if you define the extra headers in the mail, such as FROM and REPLY-TO, you shouldn't have any problems. basically, it's just like fake-mail, and your recipient should be none-the-wiser unless he really wants to sift through the headers. - Original Message - From: Brian S. Drexler [EMAIL PROTECTED] To: 'CPT John W. Holmes' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, July 18, 2003 4:10 PM Subject: RE: [PHP] Mail From option in PHP.ini I tried the extra header. The problem is with the return receipts. The mail is being generated by a server other than my main e-mail server, so if I want a delivery/read receipt I have to specify a From e-mail address or else it will default to the user executing the script, i.e. [EMAIL PROTECTED] ini_set() does not appear to work with sendmail_path. sendmail_path is in the PHP_INI_SYSTEM group so it can only be set in the php.ini or httpd.conf...Thanks for the suggestion though... -Original Message- From: CPT John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:09 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Mail From option in PHP.ini Ok, I want to specify who the mail is coming from by using the sendmail_path option in the PHP.ini. I've added the [EMAIL PROTECTED] to it, but I want to be able to dynmaically change [EMAIL PROTECTED] to [EMAIL PROTECTED] or whatever else. Anyone have any ideas how I can do this? I'm pulling the e-mail I'd like to change it to from a MySQL database but can I rewrite the php.ini file on the fly or am I stuck. Any help is greatly appreciated. Why not just put it in the extra headers? $headers .= From: $email_address_from_your_database\r\n; Or you could possibly use ini_set() to change the php.ini setting. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mail From option in PHP.ini
No, I tried this too. Here is what I've tried $hdrs = array( 'From'= ''.$FullName.' '.$Email.'', 'Return-Path' = $Email, //'From'= $Email, //'Disposition-Notification-To' = ''.$FullName.' '.$Email.'', 'Disposition-Notification-To' = $Email, 'Return-Receipt-To' = '' .$FullName.' '.$Email.'', //'Return-Path' = $Email, 'Subject' = 'Your Quote # '.$Theresult ); The commented out ones were also tried -Original Message- From: sven [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:23 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Mail From option in PHP.ini ... and how about this? $headers .= Return-Path: $email_address_from_your_database\r\n; tell me, if it works. ciao SVEN Brian S. Drexler wrote: I tried the extra header. The problem is with the return receipts. The mail is being generated by a server other than my main e-mail server, so if I want a delivery/read receipt I have to specify a From e-mail address or else it will default to the user executing the script, i.e. [EMAIL PROTECTED] ini_set() does not appear to work with sendmail_path. sendmail_path is in the PHP_INI_SYSTEM group so it can only be set in the php.ini or httpd.conf...Thanks for the suggestion though... -Original Message- From: CPT John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:09 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Mail From option in PHP.ini Ok, I want to specify who the mail is coming from by using the sendmail_path option in the PHP.ini. I've added the [EMAIL PROTECTED] to it, but I want to be able to dynmaically change [EMAIL PROTECTED] to [EMAIL PROTECTED] or whatever else. Anyone have any ideas how I can do this? I'm pulling the e-mail I'd like to change it to from a MySQL database but can I rewrite the php.ini file on the fly or am I stuck. Any help is greatly appreciated. Why not just put it in the extra headers? $headers .= From: $email_address_from_your_database\r\n; Or you could possibly use ini_set() to change the php.ini setting. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mail From option in PHP.ini
I take it you've also tried setting Reply-To: ?? Same format as From: Mark -Original Message- From: Brian S. Drexler [mailto:[EMAIL PROTECTED] Sent: 18 July 2003 16:25 To: 'sven'; php-general Subject: RE: [PHP] Mail From option in PHP.ini No, I tried this too. Here is what I've tried $hdrs = array( 'From'= ''.$FullName.' '.$Email.'', 'Return-Path' = $Email, //'From'= $Email, //'Disposition-Notification-To' = ''.$FullName.' '.$Email.'', 'Disposition-Notification-To' = $Email, 'Return-Receipt-To' = '' .$FullName.' '.$Email.'', //'Return-Path' = $Email, 'Subject' = 'Your Quote # '.$Theresult ); The commented out ones were also tried -Original Message- From: sven [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:23 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Mail From option in PHP.ini ... and how about this? $headers .= Return-Path: $email_address_from_your_database\r\n; tell me, if it works. ciao SVEN Brian S. Drexler wrote: I tried the extra header. The problem is with the return receipts. The mail is being generated by a server other than my main e-mail server, so if I want a delivery/read receipt I have to specify a From e-mail address or else it will default to the user executing the script, i.e. [EMAIL PROTECTED] ini_set() does not appear to work with sendmail_path. sendmail_path is in the PHP_INI_SYSTEM group so it can only be set in the php.ini or httpd.conf...Thanks for the suggestion though... -Original Message- From: CPT John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:09 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Mail From option in PHP.ini Ok, I want to specify who the mail is coming from by using the sendmail_path option in the PHP.ini. I've added the [EMAIL PROTECTED] to it, but I want to be able to dynmaically change [EMAIL PROTECTED] to [EMAIL PROTECTED] or whatever else. Anyone have any ideas how I can do this? I'm pulling the e-mail I'd like to change it to from a MySQL database but can I rewrite the php.ini file on the fly or am I stuck. Any help is greatly appreciated. Why not just put it in the extra headers? $headers .= From: $email_address_from_your_database\r\n; Or you could possibly use ini_set() to change the php.ini setting. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mail From option in PHP.ini
Yes, sorry...forgot to include that one...:-) -Original Message- From: M.A.Bond [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:31 AM To: 'sysadmin'; 'sven'; php-general Subject: RE: [PHP] Mail From option in PHP.ini I take it you've also tried setting Reply-To: ?? Same format as From: Mark -Original Message- From: Brian S. Drexler [mailto:[EMAIL PROTECTED] Sent: 18 July 2003 16:25 To: 'sven'; php-general Subject: RE: [PHP] Mail From option in PHP.ini No, I tried this too. Here is what I've tried $hdrs = array( 'From'= ''.$FullName.' '.$Email.'', 'Return-Path' = $Email, //'From'= $Email, //'Disposition-Notification-To' = ''.$FullName.' '.$Email.'', 'Disposition-Notification-To' = $Email, 'Return-Receipt-To' = '' .$FullName.' '.$Email.'', //'Return-Path' = $Email, 'Subject' = 'Your Quote # '.$Theresult ); The commented out ones were also tried -Original Message- From: sven [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:23 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Mail From option in PHP.ini ... and how about this? $headers .= Return-Path: $email_address_from_your_database\r\n; tell me, if it works. ciao SVEN Brian S. Drexler wrote: I tried the extra header. The problem is with the return receipts. The mail is being generated by a server other than my main e-mail server, so if I want a delivery/read receipt I have to specify a From e-mail address or else it will default to the user executing the script, i.e. [EMAIL PROTECTED] ini_set() does not appear to work with sendmail_path. sendmail_path is in the PHP_INI_SYSTEM group so it can only be set in the php.ini or httpd.conf...Thanks for the suggestion though... -Original Message- From: CPT John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:09 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Mail From option in PHP.ini Ok, I want to specify who the mail is coming from by using the sendmail_path option in the PHP.ini. I've added the [EMAIL PROTECTED] to it, but I want to be able to dynmaically change [EMAIL PROTECTED] to [EMAIL PROTECTED] or whatever else. Anyone have any ideas how I can do this? I'm pulling the e-mail I'd like to change it to from a MySQL database but can I rewrite the php.ini file on the fly or am I stuck. Any help is greatly appreciated. Why not just put it in the extra headers? $headers .= From: $email_address_from_your_database\r\n; Or you could possibly use ini_set() to change the php.ini setting. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mail From option in PHP.ini
From the php website, it appears that the [EMAIL PROTECTED] can be put in the fifth parameter of the mail() function: Example 3. Sending mail with extra headers and setting an additional command line parameter. mail([EMAIL PROTECTED], the subject, $message, From: [EMAIL PROTECTED], [EMAIL PROTECTED]); Note: This fifth parameter was added in PHP 4.0.5. Since PHP 4.2.3 this parameter is disabled in safe_mode and the mail() function will expose a warning message and return FALSE if you're trying to use it. --- Brian S. Drexler [EMAIL PROTECTED] wrote: Yes, sorry...forgot to include that one...:-) -Original Message- From: M.A.Bond [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:31 AM To: 'sysadmin'; 'sven'; php-general Subject: RE: [PHP] Mail From option in PHP.ini I take it you've also tried setting Reply-To: ?? Same format as From: Mark -Original Message- From: Brian S. Drexler [mailto:[EMAIL PROTECTED] Sent: 18 July 2003 16:25 To: 'sven'; php-general Subject: RE: [PHP] Mail From option in PHP.ini No, I tried this too. Here is what I've tried $hdrs = array( 'From'= ''.$FullName.' '.$Email.'', 'Return-Path' = $Email, //'From'= $Email, //'Disposition-Notification-To' = ''.$FullName.' '.$Email.'', 'Disposition-Notification-To' = $Email, 'Return-Receipt-To' = '' .$FullName.' '.$Email.'', //'Return-Path' = $Email, 'Subject' = 'Your Quote # '.$Theresult ); The commented out ones were also tried -Original Message- From: sven [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:23 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Mail From option in PHP.ini ... and how about this? $headers .= Return-Path: $email_address_from_your_database\r\n; tell me, if it works. ciao SVEN Brian S. Drexler wrote: I tried the extra header. The problem is with the return receipts. The mail is being generated by a server other than my main e-mail server, so if I want a delivery/read receipt I have to specify a From e-mail address or else it will default to the user executing the script, i.e. [EMAIL PROTECTED] ini_set() does not appear to work with sendmail_path. sendmail_path is in the PHP_INI_SYSTEM group so it can only be set in the php.ini or httpd.conf...Thanks for the suggestion though... -Original Message- From: CPT John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:09 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Mail From option in PHP.ini Ok, I want to specify who the mail is coming from by using the sendmail_path option in the PHP.ini. I've added the [EMAIL PROTECTED] to it, but I want to be able to dynmaically change [EMAIL PROTECTED] to [EMAIL PROTECTED] or whatever else. Anyone have any ideas how I can do this? I'm pulling the e-mail I'd like to change it to from a MySQL database but can I rewrite the php.ini file on the fly or am I stuck. Any help is greatly appreciated. Why not just put it in the extra headers? $headers .= From: $email_address_from_your_database\r\n; Or you could possibly use ini_set() to change the php.ini setting. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php = Mark Weinstock [EMAIL PROTECTED] *** You can't demand something as a right unless you are willing to fight to death to defend everyone else's right to the same thing. *** __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mail From option in PHP.ini
GREAT!!! I guess I need to RTFM...:-) Thanks again for all your help everyone! -Original Message- From: Mark [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:38 AM To: [EMAIL PROTECTED]; 'M.A.Bond'; 'sven'; 'php-general' Subject: RE: [PHP] Mail From option in PHP.ini From the php website, it appears that the [EMAIL PROTECTED] can be put in the fifth parameter of the mail() function: Example 3. Sending mail with extra headers and setting an additional command line parameter. mail([EMAIL PROTECTED], the subject, $message, From: [EMAIL PROTECTED], [EMAIL PROTECTED]); Note: This fifth parameter was added in PHP 4.0.5. Since PHP 4.2.3 this parameter is disabled in safe_mode and the mail() function will expose a warning message and return FALSE if you're trying to use it. --- Brian S. Drexler [EMAIL PROTECTED] wrote: Yes, sorry...forgot to include that one...:-) -Original Message- From: M.A.Bond [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:31 AM To: 'sysadmin'; 'sven'; php-general Subject: RE: [PHP] Mail From option in PHP.ini I take it you've also tried setting Reply-To: ?? Same format as From: Mark -Original Message- From: Brian S. Drexler [mailto:[EMAIL PROTECTED] Sent: 18 July 2003 16:25 To: 'sven'; php-general Subject: RE: [PHP] Mail From option in PHP.ini No, I tried this too. Here is what I've tried $hdrs = array( 'From'= ''.$FullName.' '.$Email.'', 'Return-Path' = $Email, //'From'= $Email, //'Disposition-Notification-To' = ''.$FullName.' '.$Email.'', 'Disposition-Notification-To' = $Email, 'Return-Receipt-To' = '' .$FullName.' '.$Email.'', //'Return-Path' = $Email, 'Subject' = 'Your Quote # '.$Theresult ); The commented out ones were also tried -Original Message- From: sven [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:23 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Mail From option in PHP.ini ... and how about this? $headers .= Return-Path: $email_address_from_your_database\r\n; tell me, if it works. ciao SVEN Brian S. Drexler wrote: I tried the extra header. The problem is with the return receipts. The mail is being generated by a server other than my main e-mail server, so if I want a delivery/read receipt I have to specify a From e-mail address or else it will default to the user executing the script, i.e. [EMAIL PROTECTED] ini_set() does not appear to work with sendmail_path. sendmail_path is in the PHP_INI_SYSTEM group so it can only be set in the php.ini or httpd.conf...Thanks for the suggestion though... -Original Message- From: CPT John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Friday, July 18, 2003 11:09 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Mail From option in PHP.ini Ok, I want to specify who the mail is coming from by using the sendmail_path option in the PHP.ini. I've added the [EMAIL PROTECTED] to it, but I want to be able to dynmaically change [EMAIL PROTECTED] to [EMAIL PROTECTED] or whatever else. Anyone have any ideas how I can do this? I'm pulling the e-mail I'd like to change it to from a MySQL database but can I rewrite the php.ini file on the fly or am I stuck. Any help is greatly appreciated. Why not just put it in the extra headers? $headers .= From: $email_address_from_your_database\r\n; Or you could possibly use ini_set() to change the php.ini setting. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php = Mark Weinstock [EMAIL PROTECTED] *** You can't demand something as a right unless you are willing to fight to death to defend everyone else's right to the same thing. *** __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MAIL FROM NO ONE
Vins, Yes, talk to port 25 of any smtp server using php. You would need to implement the full RFCs on smtp and its re-inventing the wheel. There are already classes to talk to whichever smtp server you want. Whichever smtp server you sent the mail to would log it, and the server it came from. Competent smtp servers will want to do both forward and reverse dns lookups on the computer connecting to it, and that is if it was an open relay (allowing anything to connect). So you would hide the originating computer in the chain in the email headers, but still leave a full audit trail in the next computer's logs. The only reason I can think of for wanting to do this is to send spam. Its the fastest way for your isp to kick you off that I know of (faster than not paying the bill). Its a Bad Idea (tm). Regards Chris vins wrote: Hi... I've just checked out a script from hotscripts.com that send email from and smtp server... I've managed to say the email has come from a server that doesn't exist but the email can still be traced... is there know way to build a php smtp server ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MAIL FROM NO ONE
On Thu, Jul 11, 2002 at 02:29:11PM +0200, vins wrote: Hi... I've just checked out a script from hotscripts.com that send email from and smtp server... The mail() does exactly the same Nothing fancy about it. I've managed to say the email has come from a server that doesn't exist but the email can still be traced... Care to show the headers? I'm just curious as to how the messages are actually produced. You have to keep in mind, that by doing something like this, the chances are really good that the majority of your email will NOT be delivered to its final destinations. Allot of SMTP servers does quite a bit of sanity checking on the headers received from an email message. They must, for example, include proper Received By (which is what is used for tracking the email), To:, From:, BCC:, etc headers. Without these, or with malformed headers, many SMTP servers will reject and bounce the email. You'll need to be *very* carefull in doing something like this. If you don't understand in very much details how SMTP works, and how SMTP servers delivers email, I'd suggest you do not attempt to tamper with it. is there know way to build a php smtp server ? PHP can't run a script in a daemon that I am aware of, so the short awnser is definately no. If you want a PHP script to simply send a message to a SMTP server, then sure, there is the mail() function, or you can open a socket to port 25 of the mail server. However, as I stated above, if you do not include proper headers (which identifies the email and make the email trackable), most SMTP servers will immediately reject the email. -- me -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MAIL FROM NO ONE
Chris Knipe wrote: On Thu, Jul 11, 2002 at 02:29:11PM +0200, vins wrote: Allot of SMTP servers does quite a bit of sanity checking on the headers received from an email message. Not in the west. They are too busy allowing in the commercial spam they are sending themselves. Otherwise you'd never be reading mail from a server called Lena.tut, as you are right now. And thank god they are not, since our ISP as a *lousy* SMTP service and I have to resort to this to make sure I can keep on working. What I do not understand is why you would need to build anything to bomb the guy. Just make sure you get an ISP that cannot track the phisical call (here many are still on protostoric pulse stations, you can find that somewhere at your place too, pretty sure). Then invent yourself a server name and run straight from sendmail, over. All you need is a temporary account from a dial-up. You are not robbing a bank, so nobody will look for you (your abuse.somewhere.co.za will say they never knew anybody, just like they said from norway and they will keep on drinking their beers). Personally I would not be cruel to anyone that has been already that mistreated by Mother Nature. Let him live with himself, it's the worst you can do to him. We got rid of Erik, but he never will :) *that* makes me happy. ðÏËÁ áÌØÂÅÒÔÏ ëÉÅ× -_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_- LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu? lOrD i'M sHiNiNg... YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE tHe TeSt, YeS iT iS ThE tEsT, yEs It Is tHe TeSt, YeS iT iS ThE tEsT, yEs It Is... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail from
Hello all. Does anyone know how i can set up the from and Return Address fields in the mail functions in php? mail([EMAIL PROTECTED], subject., body., From: php@$SERVER_NAME\n); -- PHP General 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] mail from
You can set them using the header field in the mail function. Checkout http://www.php.net/mail Jan De Luyck -Original Message- From: PHP [mailto:[EMAIL PROTECTED]] Sent: Monday, August 20, 2001 11:26 AM To: [EMAIL PROTECTED] Subject: [PHP] mail from Hello all. Does anyone know how i can set up the from and Return Address fields in the mail functions in php? thanks -- PHP General 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 General 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] mail from
Use the header field in the mail function: $header =From: [EMAIL PROTECTED]\n; $header .=X-Sender: [EMAIL PROTECTED]\n; $header .=X-Mailer: PHP\n; $header .=Reply-To: [EMAIL PROTECTED]\n; $header .=Return-Path: [EMAIL PROTECTED]\n; ... mail($recipient, $subject, $message, $header); hope this helps, Tony G. Bolaño