RE: [PHP] two small issues with php mail
Sir, you are very kind, but your implementation of array has me as the monkey with a light bulb I know BASIC (the language) at a minimal. Basic functionality I know; Your implementation of core knowledge programming to php quarks is blowing my mind when looking at my existing problem. #1 You build your array with; = array( 'Function 1', 'function 2', //... ); ? //... ); ?? Skip the ... and end with ): Php has enough goof ball stuff, with it's mail function. Your suggestion is kind but you are shooting over my head... $headers = implode(\r\n, $headers); Implode Hmmm = build array here but, the usage of \r\n is already confusing me. The manual says to use it for Bcc Parse error says otherwise when not in you array. Why? Else blame casey Never, you are trying to help! Brad -Original Message- From: Casey [mailto:[EMAIL PROTECTED] Sent: Monday, November 19, 2007 9:48 PM To: Brad Cc: Andrés Robinet; php-general@lists.php.net Subject: Re: [PHP] two small issues with php mail Note this code is untested and directly typed from a phone. ?php $to = '[EMAIL PROTECTED]'; $subject = 'Free iPod!'; $message = 'Even though I will be filtered, get your FREE iPod at http://www.obviouslyascam.com !'; $headers = array( 'From: [EMAIL PROTECTED]', 'Bbc: [EMAIL PROTECTED]', // ... ); $headers = implode(\r\n, $headers); if (mail($to, $subject, $message, $headers)) echo 'Success!'; else blameCasey(); ? Note: you might need to change some code before you use it (in an attempt to stop you from ripping off my code). On Nov 19, 2007, at 6:26 PM, Brad [EMAIL PROTECTED] wrote: For the purposes of this task, mailer is not an option. This is a class assignment to put us into the weeds. I am neck deep googling the heck out of this and finding snippets of un-related code which do not fit. Just seek help from a knowledgeable community to help me past the learning curve. And getting hit hard from hecklers in the process. I am not having a good day with php! I took this class because of it's Linux and Unix origin... I am not having a good day! -Original Message- From: Andrés Robinet [mailto:[EMAIL PROTECTED] Sent: Monday, November 19, 2007 8:49 PM To: 'Brad' Cc: php-general@lists.php.net Subject: RE: [PHP] two small issues with php mail Did I miss something or the following line in your code is useless? $smtp = localhost; Brad, if you really need SMTP configuration, and you want to make your life easier with attachments and extra headers, give a chance to PHPMailer http://phpmailer.codeworxtech.com/. It's free, easy to set up and use, and can do much more than you need. Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com Confidentiality: All information in this email message, including images, attachments, contains confidential and proprietary information of BESTPLACE CORPORATION and should only be used or serves for the intended purpose and should not be copied, used or disclosed to anyone other than the sole recipient of this e-mail message. -Original Message- From: Brad [mailto:[EMAIL PROTECTED] Sent: Monday, November 19, 2007 10:27 PM To: php-general@lists.php.net Subject: FW: [PHP] two small issues with php mail _ From: Brad [mailto:[EMAIL PROTECTED] Sent: Monday, November 19, 2007 8:26 PM To: 'David Giragosian' Subject: RE: [PHP] two small issues with php mail My original issue is trying to implement a Bcc and Emails are only making it to 50% of the recipients. Research and past experience says that I need to implement smtp into my code. Testing of the present parse free code show that email addresses on the same server: To: works Bcc: does not Once Bcc: works on same server, I will need to test Bcc on another server which I am sure requires the proper smtp configuration. Working code: ? $email = $_REQUEST['email']; $fromaddress = '[EMAIL PROTECTED]'; $fromname = g'; $eol = \r\n; $smtp = localhost; $headers = 'From: '.$fromname.' '.$fromaddress.''.$eol; $headers .= 'Bcc: [EMAIL PROTECTED]'; $eol = \r\n; $headers .= 'Reply-To: '.$fromname.' '.$fromaddress.''.$eol; $headers .= 'Return-Path: '.$fromname.' '.$fromaddress.''.$eol; $headers .= 'X-Mailer: PHP '.phpversion().$eol; $headers .= 'Content-Type: text/html; charset=iso-8859-1'.$eol; $headers .= 'Content-Transfer-Encoding: 8bit'; $subject = 'Your free book!'; $body = 'a href=http://www..com/freePDF/ autopilotebook.pdfClic k ME/a Here is your FREE autopilot book'; mail($email, $subject, $body, $headers); ? _ From: David Giragosian [mailto:[EMAIL PROTECTED
RE: [PHP] two small issues with php mail
Brad, This comment is extracted directly from PHPMailer source (before the implementation for the function AddBCC) /** * Adds a Bcc address. Note: this function works * with the SMTP mailer on win32, not with the mail * mailer. * @param string $address * @param string $name * @return void */ I don't really know the internals of how and why Bcc won't work with the mail function on windows, but if these guys who developed PHPMailer say so... Holy Word, so I wouldn't expect the mail function on Windows to work with Bcc. What you can do? Well... if Bcc is a requirement and you MUST do the code for Windows+PHP you'll have to write you own code to login to a SMTP server or use PHPMailer... (or any other ready made solution). If this is an assignment I really doubt your teacher's expectations are so high to let you go and develop such a thing (a class to interface a SMTP server). If you are testing the code in your Windows PC, I would recommend you testing your code in a real-world linux server, if that's an option for you. Other options include testing it on a linux box (if you have one, or you have a Windows-Linux dual boot as many people have) or even downloading the VMWare Player (http://www.vmware.com/) and one of the linux appliances that come with the LAMP suite from the start (if you don't have linux, or want to run linux while working in windows applications such as Dreamweaver). That said, don't blame PHP, don't blame us, and don't even blame your code, Bcc is not working due to an issue of the mail function in Windows (don't know why, I'm not an expert in the subject, and don't care either, I use PHPMailer). If you get the issue solved, we would also like to hear it. Rob -Original Message- From: Brad [mailto:[EMAIL PROTECTED] Sent: Monday, November 19, 2007 11:49 PM To: php-general@lists.php.net Subject: FW: [PHP] two small issues with php mail -Original Message- From: Brad [mailto:[EMAIL PROTECTED] Sent: Monday, November 19, 2007 9:48 PM To: 'Chris' Subject: RE: [PHP] two small issues with php mail Sir, I am trying... It just is not working... I am trying to implement the auth info, I go from parse error to no response from the server. I am reading your material and batting ZERO! I will keep on reading and somehow figure it out. You have been kind. I have the admin of this list now being a jerk! Brad -Original Message- From: Chris [mailto:[EMAIL PROTECTED] Sent: Monday, November 19, 2007 9:39 PM To: Brad Cc: php-general@lists.php.net Subject: Re: [PHP] two small issues with php mail Brad wrote: For the purposes of this task, mailer is not an option. This is a class assignment to put us into the weeds. I am neck deep googling the heck out of this and finding snippets of un-related code which do not fit. Just because you can't use php-mailer in your project doesn't mean you can't use it as a reference. Grab phpmailer and look at the process it follows to do smtp sending. smtp authentication is a pain at the best of times but trying to do it the way you are now will just drive you mad (been there, done that). Looking at a working code sample will make things a lot clearer in your head rather than random code from 100 different locations. http://www.cosmonroe.org/~devin/postfix/smtp-auth.txt under SMTP Authentication will give you an idea of what you need to do but there is a ton more error checking and validation you need to do along the way. -- Postgresql php tutorials http://www.designmagick.com/ No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007 5:15 PM No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007 5:15 PM No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.503 / Virus Database: 269.16.0/1137 - Release Date: 11/18/2007 5:15 PM -- 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] two small issues with php mail
The reason I am using \r\n is because the PHP Manual says so (http://us2.php.net/manual/en/function.mail.php#id367). I use implode because it is easier [in my opinion], but you will achieve the same result with: From: [EMAIL PROTECTED]: [EMAIL PROTECTED]; On Nov 19, 2007 7:22 PM, Brad [EMAIL PROTECTED] wrote: Sir, you are very kind, but your implementation of array has me as the monkey with a light bulb I know BASIC (the language) at a minimal. Basic functionality I know; Your implementation of core knowledge programming to php quarks is blowing my mind when looking at my existing problem. #1 You build your array with; = array( 'Function 1', 'function 2', //... ); ? //... ); ?? Skip the ... and end with ): Php has enough goof ball stuff, with it's mail function. Your suggestion is kind but you are shooting over my head... $headers = implode(\r\n, $headers); Implode Hmmm = build array here but, the usage of \r\n is already confusing me. The manual says to use it for Bcc Parse error says otherwise when not in you array. Why? Else blame casey Never, you are trying to help! Brad -Original Message- From: Casey [mailto:[EMAIL PROTECTED] Sent: Monday, November 19, 2007 9:48 PM To: Brad Cc: Andrés Robinet; php-general@lists.php.net Subject: Re: [PHP] two small issues with php mail Note this code is untested and directly typed from a phone. ?php $to = '[EMAIL PROTECTED]'; $subject = 'Free iPod!'; $message = 'Even though I will be filtered, get your FREE iPod at http://www.obviouslyascam.com !'; $headers = array( 'From: [EMAIL PROTECTED]', 'Bbc: [EMAIL PROTECTED]', // ... ); $headers = implode(\r\n, $headers); if (mail($to, $subject, $message, $headers)) echo 'Success!'; else blameCasey(); ? Note: you might need to change some code before you use it (in an attempt to stop you from ripping off my code). On Nov 19, 2007, at 6:26 PM, Brad [EMAIL PROTECTED] wrote: For the purposes of this task, mailer is not an option. This is a class assignment to put us into the weeds. I am neck deep googling the heck out of this and finding snippets of un-related code which do not fit. Just seek help from a knowledgeable community to help me past the learning curve. And getting hit hard from hecklers in the process. I am not having a good day with php! I took this class because of it's Linux and Unix origin... I am not having a good day! -Original Message- From: Andrés Robinet [mailto:[EMAIL PROTECTED] Sent: Monday, November 19, 2007 8:49 PM To: 'Brad' Cc: php-general@lists.php.net Subject: RE: [PHP] two small issues with php mail Did I miss something or the following line in your code is useless? $smtp = localhost; Brad, if you really need SMTP configuration, and you want to make your life easier with attachments and extra headers, give a chance to PHPMailer http://phpmailer.codeworxtech.com/. It's free, easy to set up and use, and can do much more than you need. Rob Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 | TEL 954-607-4207 | FAX 954-337-2695 | Email: [EMAIL PROTECTED] | MSN Chat: [EMAIL PROTECTED] | SKYPE: bestplace | Web: bestplace.biz | Web: seo-diy.com Confidentiality: All information in this email message, including images, attachments, contains confidential and proprietary information of BESTPLACE CORPORATION and should only be used or serves for the intended purpose and should not be copied, used or disclosed to anyone other than the sole recipient of this e-mail message. -Original Message- From: Brad [mailto:[EMAIL PROTECTED] Sent: Monday, November 19, 2007 10:27 PM To: php-general@lists.php.net Subject: FW: [PHP] two small issues with php mail _ From: Brad [mailto:[EMAIL PROTECTED] Sent: Monday, November 19, 2007 8:26 PM To: 'David Giragosian' Subject: RE: [PHP] two small issues with php mail My original issue is trying to implement a Bcc and Emails are only making it to 50% of the recipients. Research and past experience says that I need to implement smtp into my code. Testing of the present parse free code show that email addresses on the same server: To: works Bcc: does not Once Bcc: works on same server, I will need to test Bcc on another server which I am sure requires the proper smtp configuration. Working code: ? $email = $_REQUEST['email']; $fromaddress = '[EMAIL PROTECTED]'; $fromname = 'g'; $eol = \r\n; $smtp = localhost; $headers = 'From: '.$fromname.' '.$fromaddress.''.$eol; $headers .= 'Bcc: [EMAIL PROTECTED]'; $eol = \r\n; $headers .= 'Reply-To: '.$fromname.' '.$fromaddress.''.$eol; $headers .= 'Return-Path: '.$fromname
Re: [PHP] two small issues with php mail
Brad wrote: It makes sense, but the Bcc is still not making it through. Not sure if the smtp portion is correct either. No parse errors, but no email from the bcc either. ? $email = $_REQUEST['email']; $fromaddress = '[EMAIL PROTECTED]'; $fromname = 'Zone of success Club'; $eol = \r\n; $smtp = localhost; I told you this earlier!!! NOTICE: you are trying to use $eol here $headers = 'From: '.$fromname.' '.$fromaddress.''.$eol; but you don't define it until HERE. $headers .= 'Bcc: [EMAIL PROTECTED]'; $eol = \r\n; MOVE IT TO THE TOP OF YOUR SCRIPT!!! secondly, this would have been averted if you would turn on error reporting and display errors (something that should be used when developing). Something along the line of this at the top of your script will do the trick. ?php // Sets error reporting level to a somewhat high level of reporting. error_reporting(E_ALL); // Sends error messages to the browser ini_set('display_errors', 1); ... ? -- Jim Lucas Perseverance is not a long race; it is many short races one after the other Walter Elliot Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Mail function doesn't work
What could happen that my mail function isn't working. I check twice my php.ini conf and it's fine. I test sendmail manually and it's OK. I also try to send mails with sendmail stoped and started and nothing happen Este correo ha sido enviado desde el Politécnico de Informática Carlos Marx de Matanzas. La gran batalla se librará en el campo de las ideas
RE: [PHP] Mail function doesn't work
[snip] What could happen that my mail function isn't working. I check twice my php.ini conf and it's fine. I test sendmail manually and it's OK. I also try to send mails with sendmail stoped and started and nothing happen [/snip] Can we see your code? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail function doesn't work
Alberto García Gómez wrote: What could happen that my mail function isn't working. I check twice my php.ini conf and it's fine. I test sendmail manually and it's OK. I also try to send mails with sendmail stoped and started and nothing happen Does your mail-server otherwise work? /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail function doesn't work
Alberto García Gómez wrote: What could happen that my mail function isn't working. I check twice my php.ini conf and it's fine. I test sendmail manually and it's OK. I also try to send mails with sendmail stoped and started and nothing happen Este correo ha sido enviado desde el Politécnico de Informática Carlos Marx de Matanzas. La gran batalla se librará en el campo de las ideas is your apache process chroot'ed ? Can PHP see the sendmail binary? -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail and quotes
Hi all, when i send a mail using mail(), every quote and double quote in the subject and in the body of the mail get escaped. Since this is somewhat ugly, especially in languages which widely uses the single quotes (as italian does), i am wandering if there is someway to avoid this. Thanks for any hint, Stefano -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: In REGALO 'Meravigliosa Creatura' la super hit di GIANNA NANNINI Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=6615d=2-11 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail and quotes
Stefano Esposito wrote: Hi all, when i send a mail using mail(), every quote and double quote in the subject and in the body of the mail get escaped. Since this is somewhat ugly, especially in languages which widely uses the single quotes (as italian does), i am wandering if there is someway to avoid this. Thanks for any hint, Stefano -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: In REGALO 'Meravigliosa Creatura' la super hit di GIANNA NANNINI Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=6615d=2-11 I bet you if you checked, the input going to your mail function call has the body/data escaped. Check that magic quotes are not turned on. This would escape all your form data being sent to the processing script. -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[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 -- Diana Castillo Tsanalytics S.A. Tel: 34 913 595 436 Fax: 34 913 595 439 Mov: 34 609 954 536 [EMAIL PROTECTED] www.tsanalytics.com -- 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] 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
[PHP] mail doesnt work
when I try to send mail using this code: mail([EMAIL PROTECTED],TEST MAIL,TESTING MAIL); I get this error: Warning: mail() [function.mail]: SMTP server response: 554 [EMAIL PROTECTED]: Recipient address rejected: Access denied in C:\Inetpub\wwwroot\intranet\test.php on line 4 my settings in php.ini are SMTP = smtp.tsanalytics.com smtp_port = 25 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail() takes too much time
Hello everybody, I am maintaining a social network site. there each user can send other mail. these mails are not real mail rather message entry to database. I added a new feature so that every message is sent to me (admin/webmaster) via email (real e-mail). I used mail function. THis is a simple mail function. all it does sends mail with the message as the mail body to my address. Thats it. no extra complexity. But the problem is I got the mail very late. after 4-6 hours. That is huge time difference. I shouldn't take more than 3-5 mins. Do you know the reason? my mail code is here, $headers = MIME-Version: 1.0\r\n; $headers .= Content-type: text/html; charset=iso-8859-1\r\n; list($myname,$mydomain)=preg_split(/\@/,$myemail,2); $headers .= From: $myname $myemail\r\n; mail([EMAIL PROTECTED], message from XXX to YYY, $message_content, $headers); -- shout at http://shiplu.awardspace.com/ Available for Hire/Contract/Full Time
Re: [PHP] mail() takes too much time
shiplu wrote: I am maintaining a social network site. there each user can send other mail. these mails are not real mail rather message entry to database. I added a new feature so that every message is sent to me (admin/webmaster) via email (real e-mail). I used mail function. THis is a simple mail function. all it does sends mail with the message as the mail body to my address. Thats it. no extra complexity. But the problem is I got the mail very late. after 4-6 hours. That is huge time difference. I shouldn't take more than 3-5 mins. Do you know the reason? my mail code is here, $headers = MIME-Version: 1.0\r\n; $headers .= Content-type: text/html; charset=iso-8859-1\r\n; list($myname,$mydomain)=preg_split(/\@/,$myemail,2); $headers .= From: $myname $myemail\r\n; mail([EMAIL PROTECTED], message from XXX to YYY, $message_content, $headers); Unless your script is actually hanging for the 4-6 hours this problem has nothing to do with PHP. How mail is delivered depends on the OS you are using, but usually it will get passed to a local MTA which then handles delivering it, at which point PHP involvement ends. I suggest you look at the Received headers in the messages your getting. You should be able to see which server is causing the delay. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() takes too much time
You might want to consider a few things: Queueing your email in a database table and sending it out in a separate process. or Finding a mail daemon that will queue quickly for you and not send directly on adding to the queue. I use the first of the two options and it works quite well for us. Gavin On 9/2/07, shiplu [EMAIL PROTECTED] wrote: Hello everybody, I am maintaining a social network site. there each user can send other mail. these mails are not real mail rather message entry to database. I added a new feature so that every message is sent to me (admin/webmaster) via email (real e-mail). I used mail function. THis is a simple mail function. all it does sends mail with the message as the mail body to my address. Thats it. no extra complexity. But the problem is I got the mail very late. after 4-6 hours. That is huge time difference. I shouldn't take more than 3-5 mins. Do you know the reason? my mail code is here, $headers = MIME-Version: 1.0\r\n; $headers .= Content-type: text/html; charset=iso-8859-1\r\n; list($myname,$mydomain)=preg_split(/\@/,$myemail,2); $headers .= From: $myname $myemail\r\n; mail([EMAIL PROTECTED], message from XXX to YYY, $message_content, $headers); -- shout at http://shiplu.awardspace.com/ Available for Hire/Contract/Full Time -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() takes too much time
shiplu wrote: Hello everybody, I am maintaining a social network site. there each user can send other mail. these mails are not real mail rather message entry to database. I added a new feature so that every message is sent to me (admin/webmaster) via email (real e-mail). I used mail function. THis is a simple mail function. all it does sends mail with the message as the mail body to my address. Thats it. no extra complexity. But the problem is I got the mail very late. after 4-6 hours. That is huge time difference. I shouldn't take more than 3-5 mins. Do you know the reason? my mail code is here, $headers = MIME-Version: 1.0\r\n; $headers .= Content-type: text/html; charset=iso-8859-1\r\n; list($myname,$mydomain)=preg_split(/\@/,$myemail,2); $headers .= From: $myname $myemail\r\n; mail([EMAIL PROTECTED], message from XXX to YYY, $message_content, $headers); This might be an issue with your MTA (Sendmail, Postfix, etc.). Have you tried sending a mail directly (ie. via shell)? Also, if it's not required that you receive a notice of each post immediately, perhaps you could instead have some process (on your computer) check the database periodically. If you go this route and you have an auto_increment id field, you should save the largest so that your script only has to retrieve messages with id last_id. brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail() silly question
I have a question that might be too silly for those of you who are PHP gurus. Here it comes: I had a mail (specifically in the headers) function call like this: $header = ; $header .= 'From: [EMAIL PROTECTED]; $header .= 'MIME-Version: 1.0\r\n; $header .= 'Content-type: text/html; charset=iso-8859-1\r\n; $header .= Reply-To: .utf8_decode($nombreVar). .utf8_decode($apellidosVar).$mailVar\r\n; $header .= X-Mailer: PHP/.phpversion().\r\n; $header .= X-Priority: 1; and the mail(...) function always returned TRUE, but the mail was NOT sent. After hours of... trial/error debugging, I noticed from an example that it should be: $header = ; $header .= 'From: [EMAIL PROTECTED]' . \r\n; $header .= 'MIME-Version: 1.0' . \r\n; $header .= 'Content-type: text/html; charset=iso-8859-1' . \r\n; $header .= Reply-To: .utf8_decode($nombreVar). .utf8_decode($apellidosVar).$mailVar\r\n; $header .= X-Mailer: PHP/.phpversion().\r\n; $header .= X-Priority: 1; Question: Why? What's the real difference between $header .= 'From: [EMAIL PROTECTED]' . \r\n; and $header .= 'From: [EMAIL PROTECTED]; ? If somebody knows, please let me know! Thank you in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() silly question
Hi, Question: Why? What's the real difference between $header .= 'From: [EMAIL PROTECTED]' . \r\n; and $header .= 'From: [EMAIL PROTECTED]; Your second declaration is incorrect: you start with a single quote ('), and you end with a double (). So, you'd say ok, let's fix it: $header .= 'From: [EMAIL PROTECTED]'; BUT, special chars like \n or \r need to be inside a double-quoted string in order to be taken into account. This one is then correct: $header .= 'From: [EMAIL PROTECTED]' . \r\n; This one as well: $header .= From: [EMAIL PROTECTED]; Ludovic André -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() silly question
On 9/1/07, Rodrigo Poblanno Balp [EMAIL PROTECTED] wrote: I have a question that might be too silly for those of you who are PHP gurus. Here it comes: I had a mail (specifically in the headers) function call like this: $header = ; $header .= 'From: [EMAIL PROTECTED]; $header .= 'MIME-Version: 1.0\r\n; $header .= 'Content-type: text/html; charset=iso-8859-1\r\n; $header .= Reply-To: .utf8_decode($nombreVar). .utf8_decode($apellidosVar).$mailVar\r\n; $header .= X-Mailer: PHP/.phpversion().\r\n; $header .= X-Priority: 1; and the mail(...) function always returned TRUE, but the mail was NOT sent. After hours of... trial/error debugging, I noticed from an example that it should be: $header = ; $header .= 'From: [EMAIL PROTECTED]' . \r\n; $header .= 'MIME-Version: 1.0' . \r\n; $header .= 'Content-type: text/html; charset=iso-8859-1' . \r\n; $header .= Reply-To: .utf8_decode($nombreVar). .utf8_decode($apellidosVar).$mailVar\r\n; $header .= X-Mailer: PHP/.phpversion().\r\n; $header .= X-Priority: 1; Question: Why? What's the real difference between $header .= 'From: [EMAIL PROTECTED]' . \r\n; and $header .= 'From: [EMAIL PROTECTED]; Actually that's a parse error ;) You have a single quote at the start and double at the end. Anyway, the reason is interpolation. See http://www.php.net/manual/en/language.types.string.php Under Single quoted: .. escape sequences for special characters will not be expanded when they occur in single quoted strings. So you end up with a literal '\r\n' at the end of the line, not an actual carriage return newline that you expect. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mail() silly question
no difference bastien Date: Sat, 1 Sep 2007 08:00:11 -0500 From: [EMAIL PROTECTED] To: php-general@lists.php.net Subject: [PHP] mail() silly question I have a question that might be too silly for those of you who are PHP gurus. Here it comes: I had a mail (specifically in the headers) function call like this: $header = ; $header .= 'From: [EMAIL PROTECTED]; $header .= 'MIME-Version: 1.0\r\n; $header .= 'Content-type: text/html; charset=iso-8859-1\r\n; $header .= Reply-To: .utf8_decode($nombreVar). .utf8_decode($apellidosVar).\r\n; $header .= X-Mailer: PHP/.phpversion().\r\n; $header .= X-Priority: 1; and the mail(...) function always returned TRUE, but the mail was NOT sent. After hours of... trial/error debugging, I noticed from an example that it should be: $header = ; $header .= 'From: [EMAIL PROTECTED]' . \r\n; $header .= 'MIME-Version: 1.0' . \r\n; $header .= 'Content-type: text/html; charset=iso-8859-1' . \r\n; $header .= Reply-To: .utf8_decode($nombreVar). .utf8_decode($apellidosVar).\r\n; $header .= X-Mailer: PHP/.phpversion().\r\n; $header .= X-Priority: 1; Question: Why? What's the real difference between $header .= 'From: [EMAIL PROTECTED]' . \r\n; and $header .= 'From: [EMAIL PROTECTED]; ? If somebody knows, please let me know! Thank you in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Discover the new Windows Vista http://search.msn.com/results.aspx?q=windows+vistamkt=en-USform=QBRE -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mail() silly question
As a general rule, use ' ' for literal strings and for strings you want escaped characters and such to take effect. Example: echo 'foo\nbar' will echo foo\nbar where as echo foo\nbar will echo foo bar Hope this helped. Brian Seymour Zend Certified Engineer AeroCoreProductions http://www.aerocore.net/ Cell: (413) 335-2656 -Original Message- From: Rodrigo Poblanno Balp [mailto:[EMAIL PROTECTED] Sent: Saturday, September 01, 2007 9:00 AM To: php-general@lists.php.net Subject: [PHP] mail() silly question I have a question that might be too silly for those of you who are PHP gurus. Here it comes: I had a mail (specifically in the headers) function call like this: $header = ; $header .= 'From: [EMAIL PROTECTED]; $header .= 'MIME-Version: 1.0\r\n; $header .= 'Content-type: text/html; charset=iso-8859-1\r\n; $header .= Reply-To: .utf8_decode($nombreVar). .utf8_decode($apellidosVar).$mailVar\r\n; $header .= X-Mailer: PHP/.phpversion().\r\n; $header .= X-Priority: 1; and the mail(...) function always returned TRUE, but the mail was NOT sent. After hours of... trial/error debugging, I noticed from an example that it should be: $header = ; $header .= 'From: [EMAIL PROTECTED]' . \r\n; $header .= 'MIME-Version: 1.0' . \r\n; $header .= 'Content-type: text/html; charset=iso-8859-1' . \r\n; $header .= Reply-To: .utf8_decode($nombreVar). .utf8_decode($apellidosVar).$mailVar\r\n; $header .= X-Mailer: PHP/.phpversion().\r\n; $header .= X-Priority: 1; Question: Why? What's the real difference between $header .= 'From: [EMAIL PROTECTED]' . \r\n; and $header .= 'From: [EMAIL PROTECTED]; ? If somebody knows, please let me know! Thank you in advance. -- 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] mail() issue
Hello All, I am having an issue with mail. include '../../Process/include/LDAP.php'; echo $user_email; $to = $user_email; $subject = 'Request Submitted Successfully!'; $message = Congratulations!\nYour request has been successfully submitted.\nThis is an automated email, please do not reply.; mail($to, $subject, $message); In the include file I am querying Active Directory and pulling the email address for the current user and assigning it to the $user_email variable. (This works fine) Then for a sanity check I am echoing out the retrieved value. (Displays the correct alue) Then, I am assigning the values for my message variables and generating the mail() message. As far as I can tell everything looks okay, however when I run my script I get the following error: PHP Warning: mail() [function.mailhttp://develop1/credit%20card%20processing/Submit/ChildSupport/function.mail]: SMTP server response: 504 br /: Recipient address rejected: need fully-qualified address. The value of $user_email when it is echoed out above is [EMAIL PROTECTED] Any ideas?
RE: [PHP] mail() issue
[snip] PHP Warning: mail() [function.mailhttp://develop1/credit%20card%20processing/Submit/ChildSu pport/function.mail]: SMTP server response: 504 br /: Recipient address rejected: need fully-qualified address. The value of $user_email when it is echoed out above is [EMAIL PROTECTED] [/snip] Just a sanity check, does the e-mail address have that period at the end of it when you echo it out? That would make the address non fully qualified because the server is expecting a top level domain to follow. Just for giggles check the FROM address as well, it needs a fully qualified domain too. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() issue
The . (period) is simply the end of my sentance in the email. The From address is specified in the php.ini and is fully qualified. If I hard code the value of $to into the mail function it works fine. $user_email = [EMAIL PROTECTED] $to = [EMAIL PROTECTED] mail($to, $subject, $message); = PHP Warning: mail() [function.mail]: SMTP server response: 504 br /: Recipient address rejected: need fully-qualified address On 8/22/07, Jay Blanchard [EMAIL PROTECTED] wrote: [snip] PHP Warning: mail() [function.mailhttp://develop1/credit%20card%20processing/Submit/ChildSu pport/function.mail]: SMTP server response: 504 br /: Recipient address rejected: need fully-qualified address. The value of $user_email when it is echoed out above is [EMAIL PROTECTED] [/snip] Just a sanity check, does the e-mail address have that period at the end of it when you echo it out? That would make the address non fully qualified because the server is expecting a top level domain to follow. Just for giggles check the FROM address as well, it needs a fully qualified domain too.
RE: [PHP] mail() issue
[snip] The . (period) is simply the end of my sentance in the email. The From address is specified in the php.ini and is fully qualified. If I hard code the value of $to into the mail function it works fine. $user_email = [EMAIL PROTECTED] $to = [EMAIL PROTECTED] mail($to, $subject, $message); = PHP Warning: mail() [function.mail]: SMTP server response: 504 br /: Recipient address rejected: need fully-qualified address [/snip] Try this echo |.$user_email.|; You may find some whitespace that needs to be trimmed. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mail() issue
-Original Message- From: Dan Shirah [mailto:[EMAIL PROTECTED] Sent: 22 August 2007 13:28 To: Jay Blanchard Cc: php-general Subject: Re: [PHP] mail() issue The . (period) is simply the end of my sentance in the email. The From address is specified in the php.ini and is fully qualified. If I hard code the value of $to into the mail function it works fine. $user_email = [EMAIL PROTECTED] $to = [EMAIL PROTECTED] mail($to, $subject, $message); = PHP Warning: mail() [function.mail]: SMTP server response: 504 br /: Recipient address rejected: need fully-qualified address Is the mail server configured correctly? Can you manually connect to it and successfully send a message? See http://www.yuki-onna.co.uk/email/smtp.html Edward -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() issue
Found the problem. At the very end of the include file was an extra break which was being pulled into the $user_email variable. Removed it and everything is working great now. Thanks so much! On 8/22/07, Edward Kay [EMAIL PROTECTED] wrote: -Original Message- From: Dan Shirah [mailto:[EMAIL PROTECTED] Sent: 22 August 2007 13:28 To: Jay Blanchard Cc: php-general Subject: Re: [PHP] mail() issue The . (period) is simply the end of my sentance in the email. The From address is specified in the php.ini and is fully qualified. If I hard code the value of $to into the mail function it works fine. $user_email = [EMAIL PROTECTED] $to = [EMAIL PROTECTED] mail($to, $subject, $message); = PHP Warning: mail() [function.mail]: SMTP server response: 504 br /: Recipient address rejected: need fully-qualified address Is the mail server configured correctly? Can you manually connect to it and successfully send a message? See http://www.yuki-onna.co.uk/email/smtp.html Edward
RE: [PHP] mail() issue
try doing a trim($email) to remove any whitespace, just in case bastien Date: Wed, 22 Aug 2007 08:27:36 -0400 From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] CC: php-general@lists.php.net Subject: Re: [PHP] mail() issue The . (period) is simply the end of my sentance in the email. The From address is specified in the php.ini and is fully qualified. If I hard code the value of $to into the mail function it works fine. $user_email = [EMAIL PROTECTED] $to = [EMAIL PROTECTED] mail($to, $subject, $message); = PHP Warning: mail() [function.mail]: SMTP server response: 504 br /: Recipient address rejected: need fully-qualified address On 8/22/07, Jay Blanchard [EMAIL PROTECTED] wrote: [snip] PHP Warning: mail() [function.mailhttp://develop1/credit%20card%20processing/Submit/ChildSu pport/function.mail]: SMTP server response: 504 br /: Recipient address rejected: need fully-qualified address. The value of $user_email when it is echoed out above is [EMAIL PROTECTED] [/snip] Just a sanity check, does the e-mail address have that period at the end of it when you echo it out? That would make the address non fully qualified because the server is expecting a top level domain to follow. Just for giggles check the FROM address as well, it needs a fully qualified domain too. _ Explore the seven wonders of the world http://search.msn.com/results.aspx?q=7+wonders+worldmkt=en-USform=QBRE
Re: [PHP] mail problem - deadline!!!!!
On 8/7/07, Luc [EMAIL PROTECTED] wrote: Good evening list, i'm having a strange mail problem: i have 2 contact-forms on a site, where 1 get's send to the e-mail account and the other doesn't. I've tested them both on my remote server and they work, but when i upload them to the clients' server, 1 doesn't arrive in the mailbox and the other one does. Code for the troublesome form: code snip -- Best regards, Luc Hello Luc: Your code is really large, you should try narrow the problem down to a specific piece of code that doesn't work. You can start with setting error_reporting to E_ALL and see if it generates any warnings, fix them if so. If that didn't help, try to remove piece of code and see when it works, when it works again, add pieces of code 1 by 1 and see which one is causing trouble. Then take a deeper look at that part, and see if you can find the problem, if not, then you can come back to this list with that small piece of code. Tijnema -- Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail problem - deadline!!!!! - SOLVED
Good evening list, Solved the problem myself :-) i changed the mail function instead of $youremail = '[EMAIL PROTECTED]', i used $to = and changed the mail fuction from: @mail($contato_email,$subjectline,$body, From: $contato_email); into @mail($to,$subjectline,$body, From: $contato_email); -- Best regards, Luc Powered by The Bat! version 3.99.3 with Windows XP (build 2600), version 5.1 Service Pack 2 and using the best browser: Opera. From St Paul's second letter to the Corithians: 'Dear Corinthians, you could have at least replied to the first ...' - Giobbe Covatta - Italian writer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with php mail
I'm having problem with php mail. When I try to create an html message with only a href='mydomain.com'mydomain/a, gmail is registering it as a spam while yahoo is not. Can you suggest solutions to my problem. Try sending a real message. Messages being too small is one indicator of a message being junk. -- Richard Heyes +44 (0)844 801 1072 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] Problem with php mail
Can you post the headers that you are using...they play a role how the message is viewed by the receiving agent bastien Date: Sat, 4 Aug 2007 21:06:53 -0700 From: [EMAIL PROTECTED] To: php-general@lists.php.net Subject: [PHP] Problem with php mail Hi Everyone, I'm having problem with php mail. When I try to create an html message with only mydomain, gmail is registering it as a spam while yahoo is not. Can you suggest solutions to my problem. Thanks, Jason Send instant messages to your online friends http://uk.messenger.yahoo.com _ Explore the seven wonders of the world http://search.msn.com/results.aspx?q=7+wonders+worldmkt=en-USform=QBRE -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with php mail
On 8/5/07, Jason Sia [EMAIL PROTECTED] wrote: Hi Everyone, I'm having problem with php mail. When I try to create an html message with only a href='mydomain.com'mydomain/a, gmail is registering it as a spam while yahoo is not. Can you suggest solutions to my problem. Thanks, Jason There are a lot of things that can make emails go to spam, as already noted the headers and the size of the message, but also a wrong title, or wrong From: address (domain email != domain mail server) can make the message go to spam Tijnema -- Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with php mail
Jason, There's a chance your domain link is listed on a spam URL realtime blocklist. Try using http://www.rulesemporium.com/cgi-bin/uribl.cgi to find out. This might also be totally wrong, just throwing that around as a possibility since you mentioned the problem happens with URLs. Does the problem also happen when you send an html email without any links? It would be really helpful to find out what part of gmail's antispam solution doesn't like your message. Does the message header information provide any clues? (it probably isn't PHP's fault the message is getting blocked) Regards, Carlton Whitehead - Original Message - From: Tijnema [EMAIL PROTECTED] To: Jason Sia [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Sunday, August 5, 2007 11:22:13 AM (GMT-0500) America/New_York Subject: Re: [PHP] Problem with php mail On 8/5/07, Jason Sia [EMAIL PROTECTED] wrote: Hi Everyone, I'm having problem with php mail. When I try to create an html message with only a href='mydomain.com'mydomain/a, gmail is registering it as a spam while yahoo is not. Can you suggest solutions to my problem. Thanks, Jason There are a lot of things that can make emails go to spam, as already noted the headers and the size of the message, but also a wrong title, or wrong From: address (domain email != domain mail server) can make the message go to spam Tijnema -- Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info -- 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] Problem with php mail
Hi Everyone, I'm having problem with php mail. When I try to create an html message with only a href='mydomain.com'mydomain/a, gmail is registering it as a spam while yahoo is not. Can you suggest solutions to my problem. Thanks, Jason Send instant messages to your online friends http://uk.messenger.yahoo.com
Re: [PHP] mail function
Check to see if you can send mail out of your server aside from the php script. Also, check the logs: error_log, maillog, messages to see what's wrong with the script or the mail function. I'm not sure if these logs exist on IIS or where they are. Siavash - Original Message - From: Animesh Joshi [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Wednesday, August 01, 2007 3:20 AM Subject: [PHP] mail function I've installed IIS (Internet information services on my windows XP machine. I've also installed php 5.0 from www.php.net. I'm trying to use the mail() function in a simple php script which uses a html form. However, i'm not able to send the mail using the mail($to, $subject, $message, $headers); function. I wonder what's wrong. Please help, i'm new to php. Animesh Joshi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail function
Animesh Joshi wrote: I've installed IIS (Internet information services on my windows XP machine. I've also installed php 5.0 from www.php.net. I'm trying to use the mail() function in a simple php script which uses a html form. However, i'm not able to send the mail using the mail($to, $subject, $message, $headers); function. I wonder what's wrong. Please help, i'm new to php. Please review the Runtime Configuration section of http://uk.php.net/mail and make sure you've told php.ini about your mail server. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail function
I've installed IIS (Internet information services on my windows XP machine. I've also installed php 5.0 from www.php.net. I'm trying to use the mail() function in a simple php script which uses a html form. However, i'm not able to send the mail using the mail($to, $subject, $message, $headers); function. I wonder what's wrong. Please help, i'm new to php. Animesh Joshi
Re: [PHP] PHP mail with attachment
Use something like http://phpmailer.sf.net/ which handles everything for you already :) Or: http://www.phpguru.org/static/htmlMimeMail5.html and http://www.phpguru.org/downloads/html.mime.mail/ -- Richard Heyes +44 (0)844 801 1072 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
[PHP] PHP mail with attachment
Hello to everyone!..I had problems with attaching a document to an email using PHP..can somebody share some ideas on how to properly do it? Thanks in advance! Vanessa -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP mail with attachment
Vanessa Vega wrote: Hello to everyone!..I had problems with attaching a document to an email using PHP..can somebody share some ideas on how to properly do it? Use something like http://phpmailer.sf.net/ which handles everything for you already :) -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail function from and reply to address problem
On Thu, July 12, 2007 6:33 pm, Tanner Postert wrote: I am currently running PHP 5.1.4 Fedora Core 5 i'm trying to exectute the following test script. ?php $to = '[EMAIL PROTECTED]'; $subject = 'the subject'; $message = 'body'; $headers = 'From: [EMAIL PROTECTED]' . \r\n . 'Reply-To: [EMAIL PROTECTED]' . \r\n . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ? You really ought to be getting the return value from mail() and checking it for success... Error-checking is good. :-) i have about 10 or so different virtual hosts running on this machine, and if i use any of them for the from reply-to addresses, it works fine, or even if i use domains I don't control like aol.com or example.com those work too, but one particular new virtual host doesn't work, it re-writes the from address to the default virtual host address. which is strange because that isn't in the php.ini anywhere, but it could just be taking the hostname. anyone have any ideas? As I understand it: If the PHP (read: Apache) User is not trusted in sendmail config, then sendmail won't let that user forge the return headers, and the return comes from the default set in sendmail configuration. Substitute postfix or whatever as appropriate for your configuration. So you now have the joy of digging into sendmail configuration. Good luck! -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail function from and reply to address problem
Richard Lynch wrote: On Thu, July 12, 2007 6:33 pm, Tanner Postert wrote: I am currently running PHP 5.1.4 Fedora Core 5 i'm trying to exectute the following test script. ?php $to = '[EMAIL PROTECTED]'; $subject = 'the subject'; $message = 'body'; $headers = 'From: [EMAIL PROTECTED]' . \r\n . 'Reply-To: [EMAIL PROTECTED]' . \r\n . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ? You really ought to be getting the return value from mail() and checking it for success... Error-checking is good. :-) i have about 10 or so different virtual hosts running on this machine, and if i use any of them for the from reply-to addresses, it works fine, or even if i use domains I don't control like aol.com or example.com those work too, but one particular new virtual host doesn't work, it re-writes the from address to the default virtual host address. which is strange because that isn't in the php.ini anywhere, but it could just be taking the hostname. anyone have any ideas? As I understand it: If the PHP (read: Apache) User is not trusted in sendmail config, then sendmail won't let that user forge the return headers, and the return comes from the default set in sendmail configuration. Which is mentioned in the documentation: http://www.php.net/manual/en/function.mail.php ;) Sendmail and exim definitely have this sort of problem, I don't think postfix or qmail do though. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail function from and reply to address problem
apache is definitely listed in the trusted users, as I mentioned, I can send from dozens of other domains, its just one specific domain that I can't. i'll let you know the results of sending the email from outside of php. On 7/12/07, Chris [EMAIL PROTECTED] wrote: Richard Lynch wrote: On Thu, July 12, 2007 6:33 pm, Tanner Postert wrote: I am currently running PHP 5.1.4 Fedora Core 5 i'm trying to exectute the following test script. ?php $to = '[EMAIL PROTECTED]'; $subject = 'the subject'; $message = 'body'; $headers = 'From: [EMAIL PROTECTED]' . \r\n . 'Reply-To: [EMAIL PROTECTED]' . \r\n . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ? You really ought to be getting the return value from mail() and checking it for success... Error-checking is good. :-) i have about 10 or so different virtual hosts running on this machine, and if i use any of them for the from reply-to addresses, it works fine, or even if i use domains I don't control like aol.com or example.com those work too, but one particular new virtual host doesn't work, it re-writes the from address to the default virtual host address. which is strange because that isn't in the php.ini anywhere, but it could just be taking the hostname. anyone have any ideas? As I understand it: If the PHP (read: Apache) User is not trusted in sendmail config, then sendmail won't let that user forge the return headers, and the return comes from the default set in sendmail configuration. Which is mentioned in the documentation: http://www.php.net/manual/en/function.mail.php ;) Sendmail and exim definitely have this sort of problem, I don't think postfix or qmail do though. -- Postgresql php tutorials http://www.designmagick.com/
Re: [PHP] mail function from and reply to address problem
mail function returns 1(true) whether or not i'm sending to the new virtual host domain name or any random domain name. turns out sendmail function does the same thing, so it looks like it's a sendmail problem... but how is that possible if i've never configured anything for this new domain except for http virtual host config? hmm. On 7/13/07, Tanner Postert [EMAIL PROTECTED] wrote: apache is definitely listed in the trusted users, as I mentioned, I can send from dozens of other domains, its just one specific domain that I can't. i'll let you know the results of sending the email from outside of php. On 7/12/07, Chris [EMAIL PROTECTED] wrote: Richard Lynch wrote: On Thu, July 12, 2007 6:33 pm, Tanner Postert wrote: I am currently running PHP 5.1.4 Fedora Core 5 i'm trying to exectute the following test script. ?php $to = '[EMAIL PROTECTED]'; $subject = 'the subject'; $message = 'body'; $headers = 'From: [EMAIL PROTECTED]' . \r\n . 'Reply-To: [EMAIL PROTECTED]' . \r\n . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ? You really ought to be getting the return value from mail() and checking it for success... Error-checking is good. :-) i have about 10 or so different virtual hosts running on this machine, and if i use any of them for the from reply-to addresses, it works fine, or even if i use domains I don't control like aol.com or example.com those work too, but one particular new virtual host doesn't work, it re-writes the from address to the default virtual host address. which is strange because that isn't in the php.ini anywhere, but it could just be taking the hostname. anyone have any ideas? As I understand it: If the PHP (read: Apache) User is not trusted in sendmail config, then sendmail won't let that user forge the return headers, and the return comes from the default set in sendmail configuration. Which is mentioned in the documentation: http://www.php.net/manual/en/function.mail.php ;) Sendmail and exim definitely have this sort of problem, I don't think postfix or qmail do though. -- Postgresql php tutorials http://www.designmagick.com/
Re: [PHP] mail function from and reply to address problem
figured it out... the domain in question's dns is set to CNAME to the main domain on that server, whereas, the remaining domains are just using the A record with the IP. I changed one of the other domains to use the CNAME and it did the same thing. So looks like thats the culprit. I'll have to comb through the sendmail configuration and find out if I can reverse this behavior. On 7/13/07, Tanner Postert [EMAIL PROTECTED] wrote: mail function returns 1(true) whether or not i'm sending to the new virtual host domain name or any random domain name. turns out sendmail function does the same thing, so it looks like it's a sendmail problem... but how is that possible if i've never configured anything for this new domain except for http virtual host config? hmm. On 7/13/07, Tanner Postert [EMAIL PROTECTED] wrote: apache is definitely listed in the trusted users, as I mentioned, I can send from dozens of other domains, its just one specific domain that I can't. i'll let you know the results of sending the email from outside of php. On 7/12/07, Chris [EMAIL PROTECTED] wrote: Richard Lynch wrote: On Thu, July 12, 2007 6:33 pm, Tanner Postert wrote: I am currently running PHP 5.1.4 Fedora Core 5 i'm trying to exectute the following test script. ?php $to = '[EMAIL PROTECTED]'; $subject = 'the subject'; $message = 'body'; $headers = 'From: [EMAIL PROTECTED]' . \r\n . 'Reply-To: [EMAIL PROTECTED]' . \r\n . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ? You really ought to be getting the return value from mail() and checking it for success... Error-checking is good. :-) i have about 10 or so different virtual hosts running on this machine, and if i use any of them for the from reply-to addresses, it works fine, or even if i use domains I don't control like aol.com or example.com those work too, but one particular new virtual host doesn't work, it re-writes the from address to the default virtual host address. which is strange because that isn't in the php.ini anywhere, but it could just be taking the hostname. anyone have any ideas? As I understand it: If the PHP (read: Apache) User is not trusted in sendmail config, then sendmail won't let that user forge the return headers, and the return comes from the default set in sendmail configuration. Which is mentioned in the documentation: http://www.php.net/manual/en/function.mail.php ;) Sendmail and exim definitely have this sort of problem, I don't think postfix or qmail do though. -- Postgresql php tutorials http://www.designmagick.com/
Re: [PHP] mail function from and reply to address problem
On 7/13/07, Tanner Postert [EMAIL PROTECTED] wrote: figured it out... the domain in question's dns is set to CNAME to the main domain on that server, whereas, the remaining domains are just using the A record with the IP. I changed one of the other domains to use the CNAME and it did the same thing. So looks like thats the culprit. I'll have to comb through the sendmail configuration and find out if I can reverse this behavior. Sendmail has a usenet newsgroup (comp.mail.sendmail), where you might be able to find someone that can help you :) Tijnema On 7/13/07, Tanner Postert [EMAIL PROTECTED] wrote: mail function returns 1(true) whether or not i'm sending to the new virtual host domain name or any random domain name. turns out sendmail function does the same thing, so it looks like it's a sendmail problem... but how is that possible if i've never configured anything for this new domain except for http virtual host config? hmm. On 7/13/07, Tanner Postert [EMAIL PROTECTED] wrote: apache is definitely listed in the trusted users, as I mentioned, I can send from dozens of other domains, its just one specific domain that I can't. i'll let you know the results of sending the email from outside of php. On 7/12/07, Chris [EMAIL PROTECTED] wrote: Richard Lynch wrote: On Thu, July 12, 2007 6:33 pm, Tanner Postert wrote: I am currently running PHP 5.1.4 Fedora Core 5 i'm trying to exectute the following test script. ?php $to = '[EMAIL PROTECTED]'; $subject = 'the subject'; $message = 'body'; $headers = 'From: [EMAIL PROTECTED]' . \r\n . 'Reply-To: [EMAIL PROTECTED]' . \r\n . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ? You really ought to be getting the return value from mail() and checking it for success... Error-checking is good. :-) i have about 10 or so different virtual hosts running on this machine, and if i use any of them for the from reply-to addresses, it works fine, or even if i use domains I don't control like aol.com or example.com those work too, but one particular new virtual host doesn't work, it re-writes the from address to the default virtual host address. which is strange because that isn't in the php.ini anywhere, but it could just be taking the hostname. anyone have any ideas? As I understand it: If the PHP (read: Apache) User is not trusted in sendmail config, then sendmail won't let that user forge the return headers, and the return comes from the default set in sendmail configuration. Which is mentioned in the documentation: http://www.php.net/manual/en/function.mail.php ;) Sendmail and exim definitely have this sort of problem, I don't think postfix or qmail do though. -- Postgresql php tutorials http://www.designmagick.com/ -- Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail function from and reply to address problem
thanks, thats exactly where I went. looks like i'm on the right track. On 7/13/07, Tijnema [EMAIL PROTECTED] wrote: On 7/13/07, Tanner Postert [EMAIL PROTECTED] wrote: figured it out... the domain in question's dns is set to CNAME to the main domain on that server, whereas, the remaining domains are just using the A record with the IP. I changed one of the other domains to use the CNAME and it did the same thing. So looks like thats the culprit. I'll have to comb through the sendmail configuration and find out if I can reverse this behavior. Sendmail has a usenet newsgroup (comp.mail.sendmail), where you might be able to find someone that can help you :) Tijnema On 7/13/07, Tanner Postert [EMAIL PROTECTED] wrote: mail function returns 1(true) whether or not i'm sending to the new virtual host domain name or any random domain name. turns out sendmail function does the same thing, so it looks like it's a sendmail problem... but how is that possible if i've never configured anything for this new domain except for http virtual host config? hmm. On 7/13/07, Tanner Postert [EMAIL PROTECTED] wrote: apache is definitely listed in the trusted users, as I mentioned, I can send from dozens of other domains, its just one specific domain that I can't. i'll let you know the results of sending the email from outside of php. On 7/12/07, Chris [EMAIL PROTECTED] wrote: Richard Lynch wrote: On Thu, July 12, 2007 6:33 pm, Tanner Postert wrote: I am currently running PHP 5.1.4 Fedora Core 5 i'm trying to exectute the following test script. ?php $to = '[EMAIL PROTECTED]'; $subject = 'the subject'; $message = 'body'; $headers = 'From: [EMAIL PROTECTED]' . \r\n . 'Reply-To: [EMAIL PROTECTED]' . \r\n . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ? You really ought to be getting the return value from mail() and checking it for success... Error-checking is good. :-) i have about 10 or so different virtual hosts running on this machine, and if i use any of them for the from reply-to addresses, it works fine, or even if i use domains I don't control like aol.com or example.com those work too, but one particular new virtual host doesn't work, it re-writes the from address to the default virtual host address. which is strange because that isn't in the php.ini anywhere, but it could just be taking the hostname. anyone have any ideas? As I understand it: If the PHP (read: Apache) User is not trusted in sendmail config, then sendmail won't let that user forge the return headers, and the return comes from the default set in sendmail configuration. Which is mentioned in the documentation: http://www.php.net/manual/en/function.mail.php ;) Sendmail and exim definitely have this sort of problem, I don't think postfix or qmail do though. -- Postgresql php tutorials http://www.designmagick.com/ -- Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info
RE: [PHP] mail function from and reply to address problem
Sounds more like the mail server than PHP. Although weird anyway ! What mail server are you using : local/remote, smtp/sendmail/qmail ? Try using whatever method and send a mail through this server from outside of PHP with the same problem parameters ? Does that work ? It should either eliminate PHP, or point the finger ! I suspect eliminate but you never know.. That's where I think I'd start anyway. Send uz an update when you have some answers. Steve -Original Message- From: Tanner Postert [mailto:[EMAIL PROTECTED] Sent: 13 July 2007 00:33 To: php-general@lists.php.net Subject: [PHP] mail function from and reply to address problem I am currently running PHP 5.1.4 Fedora Core 5 i'm trying to exectute the following test script. ?php $to = '[EMAIL PROTECTED]'; $subject = 'the subject'; $message = 'body'; $headers = 'From: [EMAIL PROTECTED]' . \r\n . 'Reply-To: [EMAIL PROTECTED]' . \r\n . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ? i have about 10 or so different virtual hosts running on this machine, and if i use any of them for the from reply-to addresses, it works fine, or even if i use domains I don't control like aol.com or example.com those work too, but one particular new virtual host doesn't work, it re-writes the from address to the default virtual host address. which is strange because that isn't in the php.ini anywhere, but it could just be taking the hostname. anyone have any ideas? thanks in advance. Tanner -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail function from and reply to address problem
I am currently running PHP 5.1.4 Fedora Core 5 i'm trying to exectute the following test script. ?php $to = '[EMAIL PROTECTED]'; $subject = 'the subject'; $message = 'body'; $headers = 'From: [EMAIL PROTECTED]' . \r\n . 'Reply-To: [EMAIL PROTECTED]' . \r\n . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ? i have about 10 or so different virtual hosts running on this machine, and if i use any of them for the from reply-to addresses, it works fine, or even if i use domains I don't control like aol.com or example.com those work too, but one particular new virtual host doesn't work, it re-writes the from address to the default virtual host address. which is strange because that isn't in the php.ini anywhere, but it could just be taking the hostname. anyone have any ideas? thanks in advance. Tanner
Re: [PHP] mail function problem
On 7/5/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Chris a écrit : web2 wrote: Chris a écrit : Try this: ? $email = [EMAIL PROTECTED]; $headers = From: .$email.\r\n; $headers .= X-Mailer: PHP/.phpversion().\r\n; if(mail([EMAIL PROTECTED],essai,test,$headers)) { echo OK: .ini_get('sendmail_path'); } else { echo NOK: .ini_get('sendmail_path'); } ? Note Same result : NOK /usr/lib/sendmail -t -i I think the problem is not in the test script. Is that the right path? Normally it's /usr/sbin/sendmail not /usr/lib . Yes, /usr/sbin/sendmail is a link to /usr/lib/sendmail. I've made tests and with the php binary (php -f myscript.php), the mail is send. It only doesn't work with the apache module (libphp5.so)... So, it confirms that the script and the PHP configuration (php.ini) are OK. Are you running SeLinux by any chance? Check your /var/log/messages and/or /var/log/syslog to see if they provide any answers. I'm not running SeLinux, I'm using Solaris 10 (AMD64), and I've checked syslog and messages but there's nothing... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Is your script being run via the CLI or the web? -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail function problem
Chris a écrit : web2 wrote: Chris a écrit : Try this: ? $email = [EMAIL PROTECTED]; $headers = From: .$email.\r\n; $headers .= X-Mailer: PHP/.phpversion().\r\n; if(mail([EMAIL PROTECTED],essai,test,$headers)) { echo OK: .ini_get('sendmail_path'); } else { echo NOK: .ini_get('sendmail_path'); } ? Note Same result : NOK /usr/lib/sendmail -t -i I think the problem is not in the test script. Is that the right path? Normally it's /usr/sbin/sendmail not /usr/lib . Yes, /usr/sbin/sendmail is a link to /usr/lib/sendmail. I've made tests and with the php binary (php -f myscript.php), the mail is send. It only doesn't work with the apache module (libphp5.so)... So, it confirms that the script and the PHP configuration (php.ini) are OK. Are you running SeLinux by any chance? Check your /var/log/messages and/or /var/log/syslog to see if they provide any answers. I'm not running SeLinux, I'm using Solaris 10 (AMD64), and I've checked syslog and messages but there's nothing... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail function problem
On 7/5/07, Daniel Brown [EMAIL PROTECTED] wrote: On 7/5/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Chris a écrit : web2 wrote: Chris a écrit : Try this: ? $email = [EMAIL PROTECTED]; $headers = From: .$email.\r\n; $headers .= X-Mailer: PHP/.phpversion().\r\n; if(mail([EMAIL PROTECTED],essai,test,$headers)) { echo OK: .ini_get('sendmail_path'); } else { echo NOK: .ini_get('sendmail_path'); } ? Note Same result : NOK /usr/lib/sendmail -t -i I think the problem is not in the test script. Is that the right path? Normally it's /usr/sbin/sendmail not /usr/lib . Yes, /usr/sbin/sendmail is a link to /usr/lib/sendmail. I've made tests and with the php binary (php -f myscript.php), the mail is send. It only doesn't work with the apache module (libphp5.so)... So, it confirms that the script and the PHP configuration (php.ini) are OK. Are you running SeLinux by any chance? Check your /var/log/messages and/or /var/log/syslog to see if they provide any answers. I'm not running SeLinux, I'm using Solaris 10 (AMD64), and I've checked syslog and messages but there's nothing... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Is your script being run via the CLI or the web? -- Daniel P. Brown he's running it on the web, as the CLI worked ;) Did you try to su to the PHP user first and then try to send the mail with the CLI? Sounds like a permission issue... Tijnema -- Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail function problem
On 7/5/07, Tijnema [EMAIL PROTECTED] wrote: he's running it on the web, as the CLI worked ;) Yeah, I knew it was mentioned before, but I couldn't remember. I think I have early-onset Alzheimer's. -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail function problem
Chris a écrit : Try this: ? $email = [EMAIL PROTECTED]; $headers = From: .$email.\r\n; $headers .= X-Mailer: PHP/.phpversion().\r\n; if(mail([EMAIL PROTECTED],essai,test,$headers)) { echo OK: .ini_get('sendmail_path'); } else { echo NOK: .ini_get('sendmail_path'); } ? Note Same result : NOK /usr/lib/sendmail -t -i I think the problem is not in the test script. Is that the right path? Normally it's /usr/sbin/sendmail not /usr/lib . Yes, /usr/sbin/sendmail is a link to /usr/lib/sendmail. I've made tests and with the php binary (php -f myscript.php), the mail is send. It only doesn't work with the apache module (libphp5.so)... So, it confirms that the script and the PHP configuration (php.ini) are OK. If you have any solutions... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail function problem
web2 wrote: Chris a écrit : Try this: ? $email = [EMAIL PROTECTED]; $headers = From: .$email.\r\n; $headers .= X-Mailer: PHP/.phpversion().\r\n; if(mail([EMAIL PROTECTED],essai,test,$headers)) { echo OK: .ini_get('sendmail_path'); } else { echo NOK: .ini_get('sendmail_path'); } ? Note Same result : NOK /usr/lib/sendmail -t -i I think the problem is not in the test script. Is that the right path? Normally it's /usr/sbin/sendmail not /usr/lib . Yes, /usr/sbin/sendmail is a link to /usr/lib/sendmail. I've made tests and with the php binary (php -f myscript.php), the mail is send. It only doesn't work with the apache module (libphp5.so)... So, it confirms that the script and the PHP configuration (php.ini) are OK. Are you running SeLinux by any chance? Check your /var/log/messages and/or /var/log/syslog to see if they provide any answers. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail function problem
Daniel Brown a écrit : On 7/2/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Daniel Brown a écrit : On 7/2/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I've already checked : - the mail logs : no mail send - and the apache error and access logs : nothing except this : 192.168.0.1 - - [02/Jul/2007:14:07:22 +0200] GET /~ee/mail.php HTTP/1.1 200 49291 - Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 192.168.0.1 - - [02/Jul/2007:14:07:22 +0200] GET /~ee/mail.php?=PHPE9568F34-D428-11d2-A769-00AA001ACF42 HTTP/1.1 200 2524 http://mysite.domain.do/~ee/mail.php; Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 192.168.0.1 - - [02/Jul/2007:14:07:22 +0200] GET /~ee/mail.php?=SUHO8567F54-D428-14d2-A769-00DA302A5F18 HTTP/1.1 200 2813 http://mysite.domain.do/~ee/mail.php; Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 192.168.0.1 - - [02/Jul/2007:14:07:22 +0200] GET /~ee/mail.php?=PHPE9568F35-D428-11d2-A769-00AA001ACF42 HTTP/1.1 200 2146 http://mysite.domain.do/~ee/mail.php; Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 Chris a écrit : [EMAIL PROTECTED] wrote: Hi, I'm running PHP 5.2.3 on Solaris 10 (AMD64). My mail function doesn't send any mail, the return value of mail function is false... But sendmail_path value is OK in php.ini, and I've tried to send a mail with sendmail on console with the same user (the apache user), and everything's ok... Does anyone have solution ? Check your mail logs and your apache logs to see if any errors are showing up. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Is it possible for you to provide your code so that we can take a look at it for you? Yes, my PHP test code is : ? ini_set(display_errors, true); ini_set(error_reporting, E_ALL); $Email=[EMAIL PROTECTED]; $headers = From: . $Email . \r\nX-Mailer: PHP/ . phpversion(); if ( mail([EMAIL PROTECTED] , essai , test, $headers) ) echo OK : .ini_get('sendmail_path'); else echo NOK : .ini_get('sendmail_path'); ? Try this: ? $email = [EMAIL PROTECTED]; $headers = From: .$email.\r\n; $headers .= X-Mailer: PHP/.phpversion().\r\n; if(mail([EMAIL PROTECTED],essai,test,$headers)) { echo OK: .ini_get('sendmail_path'); } else { echo NOK: .ini_get('sendmail_path'); } ? Note Same result : NOK /usr/lib/sendmail -t -i I think the problem is not in the test script. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail function problem
Try this: ? $email = [EMAIL PROTECTED]; $headers = From: .$email.\r\n; $headers .= X-Mailer: PHP/.phpversion().\r\n; if(mail([EMAIL PROTECTED],essai,test,$headers)) { echo OK: .ini_get('sendmail_path'); } else { echo NOK: .ini_get('sendmail_path'); } ? Note Same result : NOK /usr/lib/sendmail -t -i I think the problem is not in the test script. Is that the right path? Normally it's /usr/sbin/sendmail not /usr/lib . -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail function problem
I've already checked : - the mail logs : no mail send - and the apache error and access logs : nothing except this : 192.168.0.1 - - [02/Jul/2007:14:07:22 +0200] GET /~ee/mail.php HTTP/1.1 200 49291 - Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 192.168.0.1 - - [02/Jul/2007:14:07:22 +0200] GET /~ee/mail.php?=PHPE9568F34-D428-11d2-A769-00AA001ACF42 HTTP/1.1 200 2524 http://mysite.domain.do/~ee/mail.php; Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 192.168.0.1 - - [02/Jul/2007:14:07:22 +0200] GET /~ee/mail.php?=SUHO8567F54-D428-14d2-A769-00DA302A5F18 HTTP/1.1 200 2813 http://mysite.domain.do/~ee/mail.php; Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 192.168.0.1 - - [02/Jul/2007:14:07:22 +0200] GET /~ee/mail.php?=PHPE9568F35-D428-11d2-A769-00AA001ACF42 HTTP/1.1 200 2146 http://mysite.domain.do/~ee/mail.php; Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 Chris a écrit : [EMAIL PROTECTED] wrote: Hi, I'm running PHP 5.2.3 on Solaris 10 (AMD64). My mail function doesn't send any mail, the return value of mail function is false... But sendmail_path value is OK in php.ini, and I've tried to send a mail with sendmail on console with the same user (the apache user), and everything's ok... Does anyone have solution ? Check your mail logs and your apache logs to see if any errors are showing up. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail function problem
On 7/2/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I've already checked : - the mail logs : no mail send - and the apache error and access logs : nothing except this : 192.168.0.1 - - [02/Jul/2007:14:07:22 +0200] GET /~ee/mail.php HTTP/1.1 200 49291 - Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 192.168.0.1 - - [02/Jul/2007:14:07:22 +0200] GET /~ee/mail.php?=PHPE9568F34-D428-11d2-A769-00AA001ACF42 HTTP/1.1 200 2524 http://mysite.domain.do/~ee/mail.php; Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 192.168.0.1 - - [02/Jul/2007:14:07:22 +0200] GET /~ee/mail.php?=SUHO8567F54-D428-14d2-A769-00DA302A5F18 HTTP/1.1 200 2813 http://mysite.domain.do/~ee/mail.php; Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 192.168.0.1 - - [02/Jul/2007:14:07:22 +0200] GET /~ee/mail.php?=PHPE9568F35-D428-11d2-A769-00AA001ACF42 HTTP/1.1 200 2146 http://mysite.domain.do/~ee/mail.php; Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 Chris a écrit : [EMAIL PROTECTED] wrote: Hi, I'm running PHP 5.2.3 on Solaris 10 (AMD64). My mail function doesn't send any mail, the return value of mail function is false... But sendmail_path value is OK in php.ini, and I've tried to send a mail with sendmail on console with the same user (the apache user), and everything's ok... Does anyone have solution ? Check your mail logs and your apache logs to see if any errors are showing up. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Is it possible for you to provide your code so that we can take a look at it for you? -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail function problem
Daniel Brown a écrit : On 7/2/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I've already checked : - the mail logs : no mail send - and the apache error and access logs : nothing except this : 192.168.0.1 - - [02/Jul/2007:14:07:22 +0200] GET /~ee/mail.php HTTP/1.1 200 49291 - Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 192.168.0.1 - - [02/Jul/2007:14:07:22 +0200] GET /~ee/mail.php?=PHPE9568F34-D428-11d2-A769-00AA001ACF42 HTTP/1.1 200 2524 http://mysite.domain.do/~ee/mail.php; Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 192.168.0.1 - - [02/Jul/2007:14:07:22 +0200] GET /~ee/mail.php?=SUHO8567F54-D428-14d2-A769-00DA302A5F18 HTTP/1.1 200 2813 http://mysite.domain.do/~ee/mail.php; Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 192.168.0.1 - - [02/Jul/2007:14:07:22 +0200] GET /~ee/mail.php?=PHPE9568F35-D428-11d2-A769-00AA001ACF42 HTTP/1.1 200 2146 http://mysite.domain.do/~ee/mail.php; Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 Chris a écrit : [EMAIL PROTECTED] wrote: Hi, I'm running PHP 5.2.3 on Solaris 10 (AMD64). My mail function doesn't send any mail, the return value of mail function is false... But sendmail_path value is OK in php.ini, and I've tried to send a mail with sendmail on console with the same user (the apache user), and everything's ok... Does anyone have solution ? Check your mail logs and your apache logs to see if any errors are showing up. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Is it possible for you to provide your code so that we can take a look at it for you? Yes, my PHP test code is : ? ini_set(display_errors, true); ini_set(error_reporting, E_ALL); $Email=[EMAIL PROTECTED]; $headers = From: . $Email . \r\nX-Mailer: PHP/ . phpversion(); if ( mail([EMAIL PROTECTED] , essai , test, $headers) ) echo OK : .ini_get('sendmail_path'); else echo NOK : .ini_get('sendmail_path'); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail function problem
On 7/2/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Daniel Brown a écrit : On 7/2/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I've already checked : - the mail logs : no mail send - and the apache error and access logs : nothing except this : 192.168.0.1 - - [02/Jul/2007:14:07:22 +0200] GET /~ee/mail.php HTTP/1.1 200 49291 - Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 192.168.0.1 - - [02/Jul/2007:14:07:22 +0200] GET /~ee/mail.php?=PHPE9568F34-D428-11d2-A769-00AA001ACF42 HTTP/1.1 200 2524 http://mysite.domain.do/~ee/mail.php; Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 192.168.0.1 - - [02/Jul/2007:14:07:22 +0200] GET /~ee/mail.php?=SUHO8567F54-D428-14d2-A769-00DA302A5F18 HTTP/1.1 200 2813 http://mysite.domain.do/~ee/mail.php; Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 192.168.0.1 - - [02/Jul/2007:14:07:22 +0200] GET /~ee/mail.php?=PHPE9568F35-D428-11d2-A769-00AA001ACF42 HTTP/1.1 200 2146 http://mysite.domain.do/~ee/mail.php; Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 Chris a écrit : [EMAIL PROTECTED] wrote: Hi, I'm running PHP 5.2.3 on Solaris 10 (AMD64). My mail function doesn't send any mail, the return value of mail function is false... But sendmail_path value is OK in php.ini, and I've tried to send a mail with sendmail on console with the same user (the apache user), and everything's ok... Does anyone have solution ? Check your mail logs and your apache logs to see if any errors are showing up. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Is it possible for you to provide your code so that we can take a look at it for you? Yes, my PHP test code is : ? ini_set(display_errors, true); ini_set(error_reporting, E_ALL); $Email=[EMAIL PROTECTED]; $headers = From: . $Email . \r\nX-Mailer: PHP/ . phpversion(); if ( mail([EMAIL PROTECTED] , essai , test, $headers) ) echo OK : .ini_get('sendmail_path'); else echo NOK : .ini_get('sendmail_path'); ? Try this: ? $email = [EMAIL PROTECTED]; $headers = From: .$email.\r\n; $headers .= X-Mailer: PHP/.phpversion().\r\n; if(mail([EMAIL PROTECTED],essai,test,$headers)) { echo OK: .ini_get('sendmail_path'); } else { echo NOK: .ini_get('sendmail_path'); } ? Note -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail function problem
On 7/2/07, Daniel Brown [EMAIL PROTECTED] wrote: {snip} Note Sorry, hit the button before I was done typing. Note the trailing \r\n after the X-Mailer line as well. -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail function problem
[EMAIL PROTECTED] wrote: Hi, I'm running PHP 5.2.3 on Solaris 10 (AMD64). My mail function doesn't send any mail, the return value of mail function is false... But sendmail_path value is OK in php.ini, and I've tried to send a mail with sendmail on console with the same user (the apache user), and everything's ok... Does anyone have solution ? Check your mail logs and your apache logs to see if any errors are showing up. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail function problem
Hi, I'm running PHP 5.2.3 on Solaris 10 (AMD64). My mail function doesn't send any mail, the return value of mail function is false... But sendmail_path value is OK in php.ini, and I've tried to send a mail with sendmail on console with the same user (the apache user), and everything's ok... Does anyone have solution ? Thanks for help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() only working with php-cli
On Sat, May 5, 2007 3:53 pm, Andy B. wrote: Is there any way to debug the mail() function within PHP4 or PHP5? Check Apache error logs. Check sendmail (or whatever) error logs. The following code is not working when called from a browser, but it does work from the command line: Often points to a paths/permissions problem... Can you 'su' to the Apache/PHP User and *then* run sendmail on command line? php and php-cli use the same php.ini file. Php via Apache is launched as a module, NOT as CGI! sendmail_path is correctly set to /usr/sbin/sendmail -t -i You put quotes around that in php.ini, right?... Cuz it needs the quotes, last I checked: sendmail_path = /usr/sbin/sendmail -t -i the /var/log/mail.log only shows activity when I try my code via command line, so my best guess is that sendmail is never reached when run from the browser. I went a little deeper and modified the sendmail_path to /tmp/test.sh, which contains: #!/bin/bash echo I was used!! /tmp/test.log (chmod 777 /tmp/test.sh) Again I tried my script from the web and from the command line. Same result... command line is fine and generates the test.log file. In the browser no log file is created. Hmmm. That blows away the quotes as an issue, at least until you got back to using multi-word path... Was sendmail installed when you compiled PHP, so PHP knows that it should be able to use it? Or, the short version of that question: Does ?php phpinfo();? show you 'mail' as an installed extension? -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mail() only working with php-cli
On Sat, May 5, 2007 5:04 pm, Andy B. wrote: Both are exactly the same, as I copied the CLI version into the Apache Version. Of course I first tested with the original Apache php.ini before overwriting it with the CLI version. I'm not quite sure what you are saying here, but the CLI version is, like, just 'php' and the Apache Module version is, like, 'libphp4.so' and you can't just swap those two binaries, almost for sure... -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mail() only working with php-cli
Thanks a lot for helping. I found the problem while trying so su to the www-user, where I was immediately told /bin/bash: permission denied. Rather unusual... The owner of the server has mistakenly changed many permissions in the /(s)bin, /usr/(s)bin directories, so that most of the files were chmod 700 instead of 755. The suid flags were also gone. It took me a while to rebuild the permissions, but after that mail() worked as it should. That being said, it really would have saved me a lot of time and anger if mail() were a little bit more verbose in situations like that. A simple error message like /usr/sbin/sendmail: permission denied would have made it. Regards, Andy -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 08, 2007 01:01 To: Andy B. Cc: php-general@lists.php.net Subject: Re: [PHP] mail() only working with php-cli On Sat, May 5, 2007 3:53 pm, Andy B. wrote: Is there any way to debug the mail() function within PHP4 or PHP5? Check Apache error logs. Check sendmail (or whatever) error logs. The following code is not working when called from a browser, but it does work from the command line: Often points to a paths/permissions problem... Can you 'su' to the Apache/PHP User and *then* run sendmail on command line? php and php-cli use the same php.ini file. Php via Apache is launched as a module, NOT as CGI! sendmail_path is correctly set to /usr/sbin/sendmail -t -i You put quotes around that in php.ini, right?... Cuz it needs the quotes, last I checked: sendmail_path = /usr/sbin/sendmail -t -i the /var/log/mail.log only shows activity when I try my code via command line, so my best guess is that sendmail is never reached when run from the browser. I went a little deeper and modified the sendmail_path to /tmp/test.sh, which contains: #!/bin/bash echo I was used!! /tmp/test.log (chmod 777 /tmp/test.sh) Again I tried my script from the web and from the command line. Same result... command line is fine and generates the test.log file. In the browser no log file is created. Hmmm. That blows away the quotes as an issue, at least until you got back to using multi-word path... Was sendmail installed when you compiled PHP, so PHP knows that it should be able to use it? Or, the short version of that question: Does ?php phpinfo();? show you 'mail' as an installed extension? -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mail() only working with php-cli
Oliver, Yes I also analyzed the log files from apache, but all they are telling me is that I am accesing the file mail.php with my browser. Error.log stays empty. I wish that it were possible to reproduce an error when accessing mail() that would somewhat look like this: cannot access /usr/sbin/sendmail: permission denied, then at least I know what needs to be done. However I doubt that my php configuration is forbidden to access this file. Andy -Original Message- From: Oliver Block [mailto:[EMAIL PROTECTED] Sent: Saturday, May 05, 2007 23:58 To: php-general@lists.php.net Cc: Andy B. Subject: Re: [PHP] mail() only working with php-cli Hello Andy, did you take a look into the apache log files? Regards, Oliver Am Samstag, 5. Mai 2007 22:53 schrieb Andy B.: Is there any way to debug the mail() function within PHP4 or PHP5? The following code is not working when called from a browser, but it does work from the command line: ?php $to = '[EMAIL PROTECTED]'; $subject = 'the subject'; $message = 'hello...'; $headers = 'From: [EMAIL PROTECTED]' . \r\n . 'Reply-To: [EMAIL PROTECTED]' . \r\n . 'X-Mailer: PHP/' . phpversion(); if(mail($to, $subject, $message, $headers)) echo IT WORKED; else echo DAMN!!!; ? php and php-cli use the same php.ini file. Php via Apache is launched as a module, NOT as CGI! sendmail_path is correctly set to /usr/sbin/sendmail -t -i the /var/log/mail.log only shows activity when I try my code via command line, so my best guess is that sendmail is never reached when run from the browser. I went a little deeper and modified the sendmail_path to /tmp/test.sh, which contains: #!/bin/bash echo I was used!! /tmp/test.log (chmod 777 /tmp/test.sh) Again I tried my script from the web and from the command line. Same result... command line is fine and generates the test.log file. In the browser no log file is created. I have already made numerous LAMP installations, but I never had this kind of mail() issue. This installation is quite simple: standard Apache 2.0 with php5, php5-mysql, php5-gd, ... This makes it even more frustrating :-( What am I missing? Thanks a lot!! Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() only working with php-cli
On 5/6/07, Andy B. [EMAIL PROTECTED] wrote: Oliver, Yes I also analyzed the log files from apache, but all they are telling me is that I am accesing the file mail.php with my browser. Error.log stays empty. I wish that it were possible to reproduce an error when accessing mail() that would somewhat look like this: cannot access /usr/sbin/sendmail: permission denied, then at least I know what needs to be done. However I doubt that my php configuration is forbidden to access this file. Andy That isn't very rare, sbin is a folder that only root can access(atleast that's how it was designed) Since you can execute the PHP CLI binary, you have SSH access to the machine. You first should check the permissions of the sendmail binary with ls -l /usr/sbin/sendmail and check the output. If you have access to the root account, then you could also try to su to the user PHP is running on and then try to access the sendmail binary. Tijnema -Original Message- From: Oliver Block [mailto:[EMAIL PROTECTED] Sent: Saturday, May 05, 2007 23:58 To: php-general@lists.php.net Cc: Andy B. Subject: Re: [PHP] mail() only working with php-cli Hello Andy, did you take a look into the apache log files? Regards, Oliver Am Samstag, 5. Mai 2007 22:53 schrieb Andy B.: Is there any way to debug the mail() function within PHP4 or PHP5? The following code is not working when called from a browser, but it does work from the command line: ?php $to = '[EMAIL PROTECTED]'; $subject = 'the subject'; $message = 'hello...'; $headers = 'From: [EMAIL PROTECTED]' . \r\n . 'Reply-To: [EMAIL PROTECTED]' . \r\n . 'X-Mailer: PHP/' . phpversion(); if(mail($to, $subject, $message, $headers)) echo IT WORKED; else echo DAMN!!!; ? php and php-cli use the same php.ini file. Php via Apache is launched as a module, NOT as CGI! sendmail_path is correctly set to /usr/sbin/sendmail -t -i the /var/log/mail.log only shows activity when I try my code via command line, so my best guess is that sendmail is never reached when run from the browser. I went a little deeper and modified the sendmail_path to /tmp/test.sh, which contains: #!/bin/bash echo I was used!! /tmp/test.log (chmod 777 /tmp/test.sh) Again I tried my script from the web and from the command line. Same result... command line is fine and generates the test.log file. In the browser no log file is created. I have already made numerous LAMP installations, but I never had this kind of mail() issue. This installation is quite simple: standard Apache 2.0 with php5, php5-mysql, php5-gd, ... This makes it even more frustrating :-( What am I missing? Thanks a lot!! Andy -- 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] mail() only working with php-cli
Is there any way to debug the mail() function within PHP4 or PHP5? The following code is not working when called from a browser, but it does work from the command line: ?php $to = '[EMAIL PROTECTED]'; $subject = 'the subject'; $message = 'hello...'; $headers = 'From: [EMAIL PROTECTED]' . \r\n . 'Reply-To: [EMAIL PROTECTED]' . \r\n . 'X-Mailer: PHP/' . phpversion(); if(mail($to, $subject, $message, $headers)) echo IT WORKED; else echo DAMN!!!; ? php and php-cli use the same php.ini file. Php via Apache is launched as a module, NOT as CGI! sendmail_path is correctly set to /usr/sbin/sendmail -t -i the /var/log/mail.log only shows activity when I try my code via command line, so my best guess is that sendmail is never reached when run from the browser. I went a little deeper and modified the sendmail_path to /tmp/test.sh, which contains: #!/bin/bash echo I was used!! /tmp/test.log (chmod 777 /tmp/test.sh) Again I tried my script from the web and from the command line. Same result... command line is fine and generates the test.log file. In the browser no log file is created. I have already made numerous LAMP installations, but I never had this kind of mail() issue. This installation is quite simple: standard Apache 2.0 with php5, php5-mysql, php5-gd, ... This makes it even more frustrating :-( What am I missing? Thanks a lot!! Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() only working with php-cli
On 5/5/07, Andy B. [EMAIL PROTECTED] wrote: Is there any way to debug the mail() function within PHP4 or PHP5? The following code is not working when called from a browser, but it does work from the command line: ?php $to = '[EMAIL PROTECTED]'; $subject = 'the subject'; $message = 'hello...'; $headers = 'From: [EMAIL PROTECTED]' . \r\n . 'Reply-To: [EMAIL PROTECTED]' . \r\n . 'X-Mailer: PHP/' . phpversion(); if(mail($to, $subject, $message, $headers)) echo IT WORKED; else echo DAMN!!!; ? php and php-cli use the same php.ini file. Php via Apache is launched as a module, NOT as CGI! sendmail_path is correctly set to /usr/sbin/sendmail -t -i the /var/log/mail.log only shows activity when I try my code via command line, so my best guess is that sendmail is never reached when run from the browser. I went a little deeper and modified the sendmail_path to /tmp/test.sh, which contains: #!/bin/bash echo I was used!! /tmp/test.log (chmod 777 /tmp/test.sh) Again I tried my script from the web and from the command line. Same result... command line is fine and generates the test.log file. In the browser no log file is created. I have already made numerous LAMP installations, but I never had this kind of mail() issue. This installation is quite simple: standard Apache 2.0 with php5, php5-mysql, php5-gd, ... This makes it even more frustrating :-( What am I missing? Thanks a lot!! Andy Are you sure that the PHP CLI and PHP-module are exactly the same build? And you could try to set error reporting level to E_ALL, maybe there's a warning generated that's hidden now because of a lower reporting level. Tijnema -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mail() only working with php-cli
Yes, it's the same build. I am running php5 on a debian distribution that has been installed via apt-get. Details: -- CLI php.ini = /etc/php5/cli/php.ini PHP 5.2.0-8+etch3 (cli) (built: Apr 29 2007 10:42:07) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies -- -- APACHE php.ini = = /etc/php5/apache2/php.ini PHP Version 5.2.0-8+etch3 System Linux A011 2.6.21 #1 SMP Fri Apr 27 22:50:50 CEST 2007 i686 Build Date Apr 29 2007 10:24:27 Server API Apache 2.0 Handler Virtual Directory Support disabled Configuration File (php.ini) Path /etc/php5/apache2/php.ini -- Both are exactly the same, as I copied the CLI version into the Apache Version. Of course I first tested with the original Apache php.ini before overwriting it with the CLI version. Unfortunately error Reporting does not help. I've already tested with E_ALL and also dumping errors/warnings into log files... Andy -Original Message- From: Tijnema ! [mailto:[EMAIL PROTECTED] Sent: Saturday, May 05, 2007 23:58 To: Andy B. Cc: php-general@lists.php.net Subject: Re: [PHP] mail() only working with php-cli Are you sure that the PHP CLI and PHP-module are exactly the same build? And you could try to set error reporting level to E_ALL, maybe there's a warning generated that's hidden now because of a lower reporting level. Tijnema -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() only working with php-cli
Hello Andy, did you take a look into the apache log files? Regards, Oliver Am Samstag, 5. Mai 2007 22:53 schrieb Andy B.: Is there any way to debug the mail() function within PHP4 or PHP5? The following code is not working when called from a browser, but it does work from the command line: ?php $to = '[EMAIL PROTECTED]'; $subject = 'the subject'; $message = 'hello...'; $headers = 'From: [EMAIL PROTECTED]' . \r\n . 'Reply-To: [EMAIL PROTECTED]' . \r\n . 'X-Mailer: PHP/' . phpversion(); if(mail($to, $subject, $message, $headers)) echo IT WORKED; else echo DAMN!!!; ? php and php-cli use the same php.ini file. Php via Apache is launched as a module, NOT as CGI! sendmail_path is correctly set to /usr/sbin/sendmail -t -i the /var/log/mail.log only shows activity when I try my code via command line, so my best guess is that sendmail is never reached when run from the browser. I went a little deeper and modified the sendmail_path to /tmp/test.sh, which contains: #!/bin/bash echo I was used!! /tmp/test.log (chmod 777 /tmp/test.sh) Again I tried my script from the web and from the command line. Same result... command line is fine and generates the test.log file. In the browser no log file is created. I have already made numerous LAMP installations, but I never had this kind of mail() issue. This installation is quite simple: standard Apache 2.0 with php5, php5-mysql, php5-gd, ... This makes it even more frustrating :-( What am I missing? Thanks a lot!! Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail function
Hi, What i understand is, you have written a new function for sending emails. Are you passing all the variables to that function? If not, you have to pass. or you can use my function ?php // function declaration, This function can send only HTML emails function sendMail ($toEmail, $subject, $message, $fromName, $fromEmail) { $header .= From: $from_name $fromEmail\n; $header .= Reply-To: $fromEmail\n; $header .= MIME-Version: 1.0\n; $header .= Content-type: text/html; charset=us-ascii; format=flowed\n; $header .= Content-Transfer-Encoding: 7bit\n; $header .= X-Mailer: php\n\n; mail($toEmail, $subject, $message, $header); } // variable values and usage $toEmail= [EMAIL PROTECTED]; $subject = Hello, This is test; $message= Hellow Shafiq, brbr This is test messagebrbrRegardsbrShafiq; $fromName= Sender Name; $fromEmail= [EMAIL PROTECTED]; sendMail ($toEmail, $subject, $message, $fromName, $fromEmail); ? -- Shafiq Rehman (ZCE) http://www.phpgurru.com | http://shafiq.pk On 4/5/07, Zhimmy Kanata [EMAIL PROTECTED] wrote: Hi, I am working on a program to create a registration feature through a email notificaiton much like this list. For functional use but also for personal training. However, I can't seem to pass the variable into the mail function() ? If I echo the variable it displays it so it must be passing the variable down. If I enter in a fixed and workable email address where $email is then it works as well. So I am a little confused to this problem. I have other programs where I do this but I place the mail function within a new function(). However, when I do that it just barks back at me. Contacted my Hosting company they are investigating. Thanks in advance for your help... Here is the code.. echo $email; echo Thanks for registering! - It does echo it. You will recieve an email shortly containing your validation code, and a link to activate your account!; mail($email, New Registration, www.sitename.com, Thanks for registering on SITE NAME. Here are your login details: Username: .$username. Password: .$password. In order to login and gain full access, you must validate your account. Click here to validate: http://www.sitename.com/login/register.php?action=activateuser= .$username.code=.$activation_code. Thanks! [Webmaster] ); I got the code from www.avengingsorrow.com to see all the code. Sorry about the HTML email. I am new to the list (first post) and I don't believe you can turn off HTML email in Yahoo. Thanks again in advance Zhimmy - Make free worldwide PC-to-PC calls. Try the new Yahoo! Canada Messenger with Voice
Re: [PHP] Mail function
Hi, Tried it...but it didn't work...Not sure why. I am using a respectable ISP and they are looking at the problem although they tend to take their time. I figure I must not be passing the variable. I will post my entire code. For all those that help again thank you. ?php require(config.php); require(functions.php); //echo some styles to spice it up... echo style body { background: #131313; font-family: Verdana, Arial; font-weight: bold; font-size: 9px; color: #FF; } .register_box { border: 1px solid #323232; background: #202020; font-family: Verdana, Arial; font-weight: bold; font-size: 9px; color: #FF; } /style ; switch($_GET['action']) { case new: //-- //[New Registration] //-- if(!isset($_POST['register'])) { echo form action='register.php?action=new' method='POST' Username: br / input type='text' name='username' class='register_box' br / Email: br / input type='text' name='email' class='register_box' br / Password: br / input type='password' name='password' class='register_box' br / input type='submit' name='register' value='New Registration!' class='register_box' /form ; } elseif(isset($_POST['register'])) { $username = mysql_real_escape_string($_POST['username']); $password = mysql_real_escape_string($_POST['password']); $email = mysql_real_escape_string($_POST['email']); $activation_code = generateCode(25); $userq = SELECT username FROM user_system WHERE username = '$username' LIMIT 1; $emailq = SELECT email FROM user_system WHERE email = '$email' LIMIT 1; //put errors into an array $errors = array(); if(empty($username)) { $errors[] = The username field was blank! br /; } if(mysql_num_rows(mysql_query($userq)) 0) { $errors[] = The username given is already in use! Please try another one! br /; } if(empty($password)) { $errors[] = The password field was blank! br /; } if(empty($email)) { $errors[] = The email field was blank! br /; } if(mysql_num_rows(mysql_query($emailq)) 0) { $errors[] = The email given is already in use! Please try another one! br /; } if(count($errors) 0) { foreach($errors as $err) { echo $err; } } else { $sqlq = INSERT INTO user_system (username, password, email, is_activated, activation_code); $sqlq .= VALUES ('$username', '.md5($password).', '$email', '0', '$activation_code'); mysql_query($sqlq) or die(mysql_error()); echo $email; - As you can see I am echoing here...so it should be passed. echo Thanks for registering! You will recieve an email shortly containing your validation code, and a link to activate your account!; mail($email, New Registration, www.sitename.com, I'm passing it here Thanks for registering on SITE NAME. Here are your login details: Username: .$username. Password: .$password. In order to login and gain full access, you must validate your account. Click here to validate: http://www.sitename.com/register.php?action=activateuser=.$username.code=.$activation_code.; Thanks! [Webmaster] ); } } break; case activate: //-- //[Activate Account] //-- if(isset($_GET['user']) isset($_GET['code'])) { $username = mysql_real_escape_string($_GET['user']); if(mysql_num_rows(mysql_query(SELECT id FROM user_system WHERE username = '$username')) == 0) { echo That username is not in the database!; } else { $activate_query = SELECT is_activated FROM user_system WHERE username = '$username'; $is_already_activated = mysql_fetch_object(mysql_query($activate_query)) or die(mysql_error()); if($is_already_activated-is_activated == 1) { echo This user is already activated!; } else { $code = mysql_real_escape_string($_GET['code']); $code_query = SELECT activation_code FROM user_system WHERE username = '$username' LIMIT 1; $check_code = mysql_fetch_object(mysql_query($code_query)) or die(mysql_error()); if($code == $check_code-activation_code) { $update = UPDATE user_system SET
[PHP] PHP Mail function
For whatever reason I can't pass the variable $email into the mail function to make it send me an email..can anyone help? Here is my code ?php require(config.php); require(functions.php); //echo some styles to spice it up... echo style body { background: #131313; font-family: Verdana, Arial; font-weight: bold; font-size: 9px; color: #FF; } .register_box { border: 1px solid #323232; background: #202020; font-family: Verdana, Arial; font-weight: bold; font-size: 9px; color: #FF; } /style ; switch($_GET['action']) { case new: //-- //[New Registration] //-- if(!isset($_POST['register'])) { echo form action='register.php?action=new' method='POST' Username: br / input type='text' name='username' class='register_box' br / Email: br / input type='text' name='email' class='register_box' br / Password: br / input type='password' name='password' class='register_box' br / input type='submit' name='register' value='New Registration!' class='register_box' /form ; } elseif(isset($_POST['register'])) { $username = mysql_real_escape_string($_POST['username']); $password = mysql_real_escape_string($_POST['password']); $email = mysql_real_escape_string($_POST['email']); $activation_code = generateCode(25); $userq = SELECT username FROM user_system WHERE username = '$username' LIMIT 1; $emailq = SELECT email FROM user_system WHERE email = '$email' LIMIT 1; //put errors into an array $errors = array(); if(empty($username)) { $errors[] = The username field was blank! br /; } if(mysql_num_rows(mysql_query($userq)) 0) { $errors[] = The username given is already in use! Please try another one! br /; } if(empty($password)) { $errors[] = The password field was blank! br /; } if(empty($email)) { $errors[] = The email field was blank! br /; } if(mysql_num_rows(mysql_query($emailq)) 0) { $errors[] = The email given is already in use! Please try another one! br /; } if(count($errors) 0) { foreach($errors as $err) { echo $err; } } else { $sqlq = INSERT INTO user_system (username, password, email, is_activated, activation_code); $sqlq .= VALUES ('$username', '.md5($password).', '$email', '0', '$activation_code'); mysql_query($sqlq) or die(mysql_error()); echo $email; --- Its being passed down... echo Thanks for registering! You will recieve an email shortly containing your validation code, and a link to activate your account!; mail($email, New Registration, www.sitename.ca, won't pick itup. Thanks for registering on SITE NAME. Here are your login details: Username: .$username. Password: .$password. In order to login and gain full access, you must validate your account. Click here to validate: http://www.sitename.ca/login/register.php?action=activateuser=.$username.code=.$activation_code.; Thanks! [Webmaster] ); } } break; case activate: //-- //[Activate Account] //-- if(isset($_GET['user']) isset($_GET['code'])) { $username = mysql_real_escape_string($_GET['user']); if(mysql_num_rows(mysql_query(SELECT id FROM user_system WHERE username = '$username')) == 0) { echo That username is not in the database!; } else { $activate_query = SELECT is_activated FROM user_system WHERE username = '$username'; $is_already_activated = mysql_fetch_object(mysql_query($activate_query)) or die(mysql_error()); if($is_already_activated-is_activated == 1) { echo This user is already activated!; } else { $code = mysql_real_escape_string($_GET['code']); $code_query = SELECT activation_code FROM user_system WHERE username = '$username' LIMIT 1; $check_code = mysql_fetch_object(mysql_query($code_query)) or die(mysql_error()); if($code == $check_code-activation_code) { $update = UPDATE user_system SET is_activated = '1' WHERE username = '$username'; mysql_query($update) or die(mysql_error()); echo User $username has been activated! Thanks! You may now login!;
[PHP] Mail function
Hi, I am working on a program to create a registration feature through a email notificaiton much like this list. For functional use but also for personal training. However, I can't seem to pass the variable into the mail function() ? If I echo the variable it displays it so it must be passing the variable down. If I enter in a fixed and workable email address where $email is then it works as well. So I am a little confused to this problem. I have other programs where I do this but I place the mail function within a new function(). However, when I do that it just barks back at me. Contacted my Hosting company they are investigating. Thanks in advance for your help... Here is the code.. echo $email; echo Thanks for registering! - It does echo it. You will recieve an email shortly containing your validation code, and a link to activate your account!; mail($email, New Registration, www.sitename.com, Thanks for registering on SITE NAME. Here are your login details: Username: .$username. Password: .$password. In order to login and gain full access, you must validate your account. Click here to validate: http://www.sitename.com/login/register.php?action=activateuser=.$username.code=.$activation_code.; Thanks! [Webmaster] ); I got the code from www.avengingsorrow.com to see all the code. Sorry about the HTML email. I am new to the list (first post) and I don't believe you can turn off HTML email in Yahoo. Thanks again in advance Zhimmy - Make free worldwide PC-to-PC calls. Try the new Yahoo! Canada Messenger with Voice
[PHP] PHP mail() problem
Hi, I'm having problem with character encoding in PHP mail functions. CODE: $headers.= Content-Type: text/html; charset=iso-8859-1; $headers .= MIME-Version: 1.0 ; $headers .= Content-Transfer-Encoding: 8bit.$eol.$eol; $headers .=Content-Type: multipart/alternative; boundary=0-92766976-1174383938=:29106; $to = [EMAIL PROTECTED]; $subject = $_POST['cat']; $body = $_POST['text']; if (mail($to, $subject, $body, $headers)) { echo('pMessage successfully sent!/pbr /a href=showarticle.php?cid=5id=3Povratak/a'); } else { echo('pMessage delivery failed.../pbr /a href=showarticle.php?cid=5id=3Povratak/a'); } Im receiving mail as you see using yahoo.com. It all works except it doesn't show croatian letters... I also tried with encoding utf-8, same thing... ČĆŽŠĐ Please help, thank you very much! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP mail() problem
2007. 03. 20, kedd keltezéssel 10.54-kor Delta Storm ezt írta: Hi, I'm having problem with character encoding in PHP mail functions. CODE: $headers.= Content-Type: text/html; charset=iso-8859-1; $headers .= MIME-Version: 1.0 ; $headers .= Content-Transfer-Encoding: 8bit.$eol.$eol; $headers .=Content-Type: multipart/alternative; boundary=0-92766976-1174383938=:29106; $to = [EMAIL PROTECTED]; $subject = $_POST['cat']; $body = $_POST['text']; you should check those values first before putting them into mail(). they can contain spammer tricks like putting newlines in the subject and then cc header lines or something similar if (mail($to, $subject, $body, $headers)) { echo('pMessage successfully sent!/pbr /a href=showarticle.php?cid=5id=3Povratak/a'); } else { echo('pMessage delivery failed.../pbr /a href=showarticle.php?cid=5id=3Povratak/a'); } Im receiving mail as you see using yahoo.com. It all works except it doesn't show croatian letters... I also tried with encoding utf-8, same thing... ČĆŽŠĐ what is the charset of the webpage displaying the form which triggers this function? it must be set to the same value as the email otherwise your email sending function won't receive the croatian letters at all, so it cannot send them too... hope that helps Zoltán Németh Please help, thank you very much! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP mail() problem
Hi. Recently I have this kind of issue. This is a possible solution: $text=message text; $subject=message subject; $header=From: [EMAIL PROTECTED]. MIME-Version: 1.0\r\n. Content-type: text/html; charset=utf-8\r\n. Content-Transfer-Encoding: 8bit\r\n; $subject2=utf8_encode($subject); $text2=utf8_encode($text); mail([EMAIL PROTECTED],$subject,$text2,$header); This encodes message to UTF-8 and should work. 2007. március 20. 10.54 dátummal Delta Storm ezt írta: Hi, I'm having problem with character encoding in PHP mail functions. CODE: $headers.= Content-Type: text/html; charset=iso-8859-1; $headers .= MIME-Version: 1.0 ; $headers .= Content-Transfer-Encoding: 8bit.$eol.$eol; $headers .=Content-Type: multipart/alternative; boundary=0-92766976-1174383938=:29106; $to = [EMAIL PROTECTED]; $subject = $_POST['cat']; $body = $_POST['text']; if (mail($to, $subject, $body, $headers)) { echo('pMessage successfully sent!/pbr /a href=showarticle.php?cid=5id=3Povratak/a'); } else { echo('pMessage delivery failed.../pbr /a href=showarticle.php?cid=5id=3Povratak/a'); } Im receiving mail as you see using yahoo.com. It all works except it doesn't show croatian letters... I also tried with encoding utf-8, same thing... ČĆŽŠĐ Please help, thank you very much! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP mail() problem
On Tue, March 20, 2007 4:54 am, Delta Storm wrote: Disclosure: What I understand of Unicode could fit in a matchbook... I'm having problem with character encoding in PHP mail functions. CODE: $headers.= Content-Type: text/html; charset=iso-8859-1; $headers .= MIME-Version: 1.0 ; $headers .= Content-Transfer-Encoding: 8bit.$eol.$eol; WILD GUESS ALERT!!! You're trying to pass 16-bit characters in an 8bit transfer encoding, whatever the heck that is... Seems to me you need a bigger bucket... You do realize that sending HTML Enhanced (cough, cough) email is quite likely to get it marked as spam and never seen by the intended recipient, right?... -- Some people have a gift link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP mail() problem
Hello, on 03/20/2007 06:54 AM Delta Storm said the following: Hi, I'm having problem with character encoding in PHP mail functions. CODE: $headers.= Content-Type: text/html; charset=iso-8859-1; $headers .= MIME-Version: 1.0 ; $headers .= Content-Transfer-Encoding: 8bit.$eol.$eol; $headers .=Content-Type: multipart/alternative; boundary=0-92766976-1174383938=:29106; $to = [EMAIL PROTECTED]; $subject = $_POST['cat']; $body = $_POST['text']; if (mail($to, $subject, $body, $headers)) { echo('pMessage successfully sent!/pbr /a href=showarticle.php?cid=5id=3Povratak/a'); } else { echo('pMessage delivery failed.../pbr /a href=showarticle.php?cid=5id=3Povratak/a'); } Im receiving mail as you see using yahoo.com. It all works except it doesn't show croatian letters... I also tried with encoding utf-8, same thing... ČĆŽŠĐ Several things are wrong. I think Croatian letters need ISO-8859-2 character set. utf-8 is fine too. Make sure you use the same encoding as you use for the HTML page where your form is. Other than that, you should not use 8bit content transfer encoding when you have non-ASCII characters in the text. You should use quoted-printable encoding for the body and q-encoding for the headers. You have multiple Content-Type headers. Only one is right. For messages with HTML, you should use only multipart/alternative. However the body must enclose both a text/plain and a text/html alternative parts. This is all a bit complicated to do with a small script like you have. It is much simpler to use ready to use components to do the hard work of message assembly for you. I use this MIME message class. It can handle all you need including non-ASCII character encoding. Take a look at the test_simple_html_mail_message.php example script. http://www.phpclasses.org/mimemessage -- Regards, Manuel Lemos Metastorage - Data object relational mapping layer generator http://www.metastorage.net/ PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Mail function undefined in PHP6
Hi, I have PHP6 installed (Snapshot:200703141130) and somehow it says now that the mail function is undefined, i have sendmail installed in /usr (is in $PATH) my configure command: './configure' '--prefix=/usr' '--with-pear' '--enable-all' '--with-apxs2' '--without-fbsql' '--without-interbase' '--without-mssql' '--with-mysql=/usr/mysql' '--with-msql=/usr/msql3' '--with-mysqli=/usr/mysql/bin/mysql_config' '--without-oci8' '--without-pdo-firebird' '--with-pdo-mysql=/usr/mysql' '--without-pdo-oci' '--without-pdo-odbc' '--with-pdo-pgsql=/usr/psql' '--with-pgsql=/usr/psql' '--without-sybase-ct' '--with-sybase' '--without-recode' '--without-informix' '--disable-mbregex' '--without-pdo-dblib' So, i don't see any reason why the mail function isn't build in... Kind Regards, Tijnema -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail function undefined in PHP6
On Sat, 2007-03-17 at 11:07 +0100, Tijnema ! wrote: Hi, I have PHP6 installed (Snapshot:200703141130) and somehow it says now that the mail function is undefined, i have sendmail installed in /usr (is in $PATH) my configure command: './configure' '--prefix=/usr' '--with-pear' '--enable-all' '--with-apxs2' '--without-fbsql' '--without-interbase' '--without-mssql' '--with-mysql=/usr/mysql' '--with-msql=/usr/msql3' '--with-mysqli=/usr/mysql/bin/mysql_config' '--without-oci8' '--without-pdo-firebird' '--with-pdo-mysql=/usr/mysql' '--without-pdo-oci' '--without-pdo-odbc' '--with-pdo-pgsql=/usr/psql' '--with-pgsql=/usr/psql' '--without-sybase-ct' '--with-sybase' '--without-recode' '--without-informix' '--disable-mbregex' '--without-pdo-dblib' So, i don't see any reason why the mail function isn't build in... You should probably field this question on internals since PHP6 doesn't even have an alpha release yet to my knowledge. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail function undefined in PHP6
On 3/17/07, Robert Cummings [EMAIL PROTECTED] wrote: On Sat, 2007-03-17 at 11:07 +0100, Tijnema ! wrote: Hi, I have PHP6 installed (Snapshot:200703141130) and somehow it says now that the mail function is undefined, i have sendmail installed in /usr (is in $PATH) my configure command: './configure' '--prefix=/usr' '--with-pear' '--enable-all' '--with-apxs2' '--without-fbsql' '--without-interbase' '--without-mssql' '--with-mysql=/usr/mysql' '--with-msql=/usr/msql3' '--with-mysqli=/usr/mysql/bin/mysql_config' '--without-oci8' '--without-pdo-firebird' '--with-pdo-mysql=/usr/mysql' '--without-pdo-oci' '--without-pdo-odbc' '--with-pdo-pgsql=/usr/psql' '--with-pgsql=/usr/psql' '--without-sybase-ct' '--with-sybase' '--without-recode' '--without-informix' '--disable-mbregex' '--without-pdo-dblib' So, i don't see any reason why the mail function isn't build in... You should probably field this question on internals since PHP6 doesn't even have an alpha release yet to my knowledge. Cheers, Rob. Ok, i've forwarded the message to PHP-DEV Tijnema -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail
On Tue, March 13, 2007 1:35 pm, Dani Dws wrote: I just want to know if the mail function works from a localhost (local server)? It *can* be made to work, even if you have not succeeded so far. I've checked my php.ini all the setting are right but the mail function is not sending any mail, any idea? Step 1. Make sure you can send email from the command line, with PHP not in the picture: mail [EMAIL PROTECTED] This is a test. . The . by itself on a line indicates the end of the message. If that doesn't successfully send out mail, then adding PHP into the mix is unlikely to also work. * Step 2. Make sure that the PHP user, which is not your usual login, can send email. su to the PHP user on the command line, and repeat step 1, and see if it works. In particular, the sendmail program has to be executable by the PHP user, and the mail configuration (usually sendmail.cf) has to allow the PHP user to send out email. If you are not using sendmail, the moral equivalent of the preceding sentence is still true. Step 3. Make sure php.ini has the correct settings for 'sendmail' (Un*x) or 'SMTP' (Windoze) * Technically, your mail server could be configured to deny access to you to send email, but allow PHP user to send email, but this is unlikely. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail
Dani Dws escribió: I just want to know if the mail function works from a localhost (local server)? I've checked my php.ini all the setting are right but the mail function is not sending any mail, any idea? How are you using it? -- select 'mmarques' || '@' || 'unl.edu.ar' AS email; - Martín Marqués | Programador, DBA Centro de Telemática| Administrador Universidad Nacional del Litoral - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail header questions solved
You can use the fifth parameter: [EMAIL PROTECTED] This will cause the from to be from [EMAIL PROTECTED] instead of from [EMAIL PROTECTED] Regards, Emmett Hi Emmett, Thanks this works. I already tried this on my local machine and it didn't work but it does work on the webserver so apparantly there's something wrong with my own MTA settings. Regards Chantal -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail header questions
Hi everyone, I'm working on a mailform and it's kind of working but I still have 2 problems: 1) I can't get the From header right, when I receive the test mail the sender is apache 2) The BCC headers (there's more then one) are not stripped. Here's my script: /* haal de gegevens op */ $to=$_POST['to']; $bcc=$_POST['bcc']; $subject=$_POST['subject']; $bericht=$_POST['bericht']; /* maak van de bcctjes een array en bouw hier de bcc headers van */ $bcc_array = explode (,, $bcc); for ($n = 0; $n count($bcc_array); $n++) { $bcclist=each($bcc_array); $bccheaders = $bccheaders . bcc: . $bcclist[value] . \r\n; } /*Nu gaan we een aantal headers bekijken en toevoegen.*/ $headers .= To: $to \r\n; /* from adres */ $headers .= From: $mainmail \r\n; /*Deze twee headers zorgen ervoor dat je een bericht met HTML kan toevoegen*/ $headers .= MIME-Version: 1.0\r\n; $headers .= Content-type: text/html; charset=iso-8859-1\r\n; /*Deze header zorgt ervoor dat als er een fout is ontstaan bij het versturen van een mailtje, dat je kan aangeven naar welke e-mailadres de fout/error gestuurd wordt.*/ $headers .= Return-Path: $mainmail\r\n; /*Deze header zorgt ervoor dat als ontvangers een reply terug willen sturen naar jou, dat hun reactie naar dit adres wordt terug gestuurd.*/ $headers .= Reply-To: $mainmail\r\n; $headers .= X-Mailer: PHP . phpversion() .\r\n; $headers = $headers . $bccheaders; mail($to, $subject, $bericht, $headers); echo Mail met onderwerp $subject is verstuurd naar $bcc en $mainmail; Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail() encoded subject line
Hi, I hope this is not too off topic but I have a problem when I use mail(). When I add the header Content-Type: text/plain; charset=UTF-8 the body of the mail is encoded fine but the subject is not encoded. I've tried to utf8_encode() and utf8_decode() the subject text but neither helps. Any idea of how to pass what encoding to use on an email subject? Thanks! Regards Emil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() encoded subject line
# [EMAIL PROTECTED] / 2006-10-16 14:32:12 +0200: I hope this is not too off topic but I have a problem when I use mail(). When I add the header Content-Type: text/plain; charset=UTF-8 the body of the mail is encoded fine but the subject is not encoded. I've tried to utf8_encode() and utf8_decode() the subject text but neither helps. Any idea of how to pass what encoding to use on an email subject? I see others already gave you some fish so I'll just offer you the fishing manual: http://www.faqs.org/rfcs/rfc2047.html -- How many Vietnam vets does it take to screw in a light bulb? You don't know, man. You don't KNOW. Cause you weren't THERE. http://bash.org/?255991 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail delivery
Is there anyway to setup a mail delivery with mail() or phpmailer? I send out a mass mail and some get returned but there is no message who they are being returned from. usually you get something like. This message was created automatically by mail delivery software. A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed: [EMAIL PROTECTED] Ross -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail delivery
On Fri, October 6, 2006 6:18 am, Ross wrote: Is there anyway to setup a mail delivery with mail() or phpmailer? I send out a mass mail and some get returned but there is no message who they are being returned from. usually you get something like. This message was created automatically by mail delivery software. A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed: [EMAIL PROTECTED] The To: line of that failed email tells you where the original came From: And then, well, it's a right old mess with all the different formats of the body to work out exactly what went wrong. What exactly are you trying to do? Cuz there are quite a few mailing list software packages already out there in PHP and other languages... -- Some people have a gift link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Mail Problem
I have an issue with sending email via PHP which may be a configuration problem with either PHP, Apache, or possibly a Sendmail, but I don't know which yet. I figured I'd start here first. Here's the situation. I have several webpages that send email to users for various reasons. We have our webserver, an intranet webserver, configured to connect to our smtp server which sits on a different box. The script looks like this: ?PHP $from = [EMAIL PROTECTED]; $to = [EMAIL PROTECTED]; $subject = Test; $msg = This is a test from my site\n\nTimestamp: . date(r); $headers = From:$from\r\n; if(!mail($to,$subject,$msg,$headers)) { die(Unable to send); } ? This works great when it works. Users receive email as expected and when they hit reply it goes back to the webmaster email address. The problem is if the to email address isn't a valid one. When this happens, the mail server bounces the message back to [EMAIL PROTECTED] instead of [EMAIL PROTECTED] I've tried adding reply-to to the mail headers and that doesn't work either. We tried sending the same failed message using webmin and that worked great, which is why I believe this to be a PHP or Apache problem. Any ideas? Thanks, Robbert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail Problem
Why not validate the email address before you send. I use something like this to kick back an error that says you put in a bad email address. It won't tell you about a wrong email address, but it will tell you if they forgot to put in the @ sign and stuff. if (!preg_match(/^(.+)@[a-zA-Z0-9-]+\.[a-zA-Z0-9.-]+$/si, $data)) { $email_error = yes; } -- Kevin Murphy Webmaster: Information and Marketing Services Western Nevada Community College www.wncc.edu 775-445-3326 On Sep 26, 2006, at 9:09 AM, [EMAIL PROTECTED] wrote: I have an issue with sending email via PHP which may be a configuration problem with either PHP, Apache, or possibly a Sendmail, but I don't know which yet. I figured I'd start here first. Here's the situation. I have several webpages that send email to users for various reasons. We have our webserver, an intranet webserver, configured to connect to our smtp server which sits on a different box. The script looks like this: ?PHP $from = [EMAIL PROTECTED]; $to = [EMAIL PROTECTED]; $subject = Test; $msg = This is a test from my site\n\nTimestamp: . date(r); $headers = From:$from\r\n; if(!mail($to,$subject,$msg,$headers)) { die(Unable to send); } ? This works great when it works. Users receive email as expected and when they hit reply it goes back to the webmaster email address. The problem is if the to email address isn't a valid one. When this happens, the mail server bounces the message back to [EMAIL PROTECTED] instead of [EMAIL PROTECTED] I've tried adding reply-to to the mail headers and that doesn't work either. We tried sending the same failed message using webmin and that worked great, which is why I believe this to be a PHP or Apache problem. Any ideas? Thanks, Robbert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php