RE: [PHP] Mail Function Problem
On Mon, 2010-04-12 at 12:25 -0400, Alice Wei wrote: Date: Mon, 12 Apr 2010 11:09:42 -0500 From: k...@daleco.biz To: aj...@alumni.iu.edu CC: a.bovane...@gmail.com; php-general@lists.php.net Subject: Re: [PHP] Mail Function Problem Alice Wei wrote: Hi! You have the following php.ini params:SMTP = smtp.live.com smtp_port = 587 live.com not support relay and it requires authentication. Is there an email account that I could try? I thought most email accounts requires authentication anyway. Well, therein lies the rub, as the Bard said (maybe). PHP's mail() was built on a general assumption that there would be a local SMTP server. It supports remote SMTP, but I'm not aware of any ability to do SMTP auth, even in the PEAR packages. You might just wanna read up on mail in general. The php.net/mail page lists several relevant RFC's, and has links to most of the PEAR mail classes, etc. You should definitely read up on live.com's email configuration. If they use SMTP auth, I'm not sure you can do this (per above). If it uses, say, POP before SMTP for authorization, you might be able to hack something together with the PHP IMAP functions, or even sockets, but you're getting into a big lotta work for what seems a small thing. This is what I am talking about. Two years ago when I first set up my own server with Linux and not Windows, I never had to deal with this. Perhaps the authentication has since then got stricter, but it should not be so much of a heck of a deal. I found this doc from ATT's website, http://helpme.att.net/pdf/uverse/uverse_hsi_qsg_english.pdf, so obviously the smtp server I provided earlier is probably not up to date. I think I will fiddle around with the php.ini file and see what else is there. Thanks. Alice _ Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1 Linux installations come with sendmail which allows you to send email directly. Windows doesn't have this as part of the base setup, but I believe if you can install a local mail server then this should fix the issue. Thanks, Ash http://www.ashleysheridan.co.uk
RE: [PHP] Mail Function Problem
Subject: RE: [PHP] Mail Function Problem From: a...@ashleysheridan.co.uk To: aj...@alumni.iu.edu CC: k...@daleco.biz; a.bovane...@gmail.com; php-general@lists.php.net Date: Tue, 13 Apr 2010 13:19:15 +0100 On Mon, 2010-04-12 at 12:25 -0400, Alice Wei wrote: Date: Mon, 12 Apr 2010 11:09:42 -0500 From: k...@daleco.biz To: aj...@alumni.iu.edu CC: a.bovane...@gmail.com; php-general@lists.php.net Subject: Re: [PHP] Mail Function Problem Alice Wei wrote: Hi! You have the following php.ini params:SMTP = smtp.live.com smtp_port = 587 live.com not support relay and it requires authentication. Is there an email account that I could try? I thought most email accounts requires authentication anyway. Well, therein lies the rub, as the Bard said (maybe). PHP's mail() was built on a general assumption that there would be a local SMTP server. It supports remote SMTP, but I'm not aware of any ability to do SMTP auth, even in the PEAR packages. You might just wanna read up on mail in general. The php.net/mail page lists several relevant RFC's, and has links to most of the PEAR mail classes, etc. You should definitely read up on live.com's email configuration. If they use SMTP auth, I'm not sure you can do this (per above). If it uses, say, POP before SMTP for authorization, you might be able to hack something together with the PHP IMAP functions, or even sockets, but you're getting into a big lotta work for what seems a small thing. This is what I am talking about. Two years ago when I first set up my own server with Linux and not Windows, I never had to deal with this. Perhaps the authentication has since then got stricter, but it should not be so much of a heck of a deal. I found this doc from ATT's website, http://helpme.att.net/pdf/uverse/uverse_hsi_qsg_english.pdf, so obviously the smtp server I provided earlier is probably not up to date. I think I will fiddle around with the php.ini file and see what else is there. Thanks. Alice _ Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1 Linux installations come with sendmail which allows you to send email directly. Windows doesn't have this as part of the base setup, but I believe if you can install a local mail server then this should fix the issue. Something like http://www.hmailserver.com/? I use ATT, why is it that I use their SMTP server and my From address in PHP.ini file didn't work? Thanks. Alice Thanks,sh http://www.ashleysheridan.co.uk _ Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1
RE: [PHP] Mail Function Problem
On Tue, 2010-04-13 at 08:59 -0400, Alice Wei wrote: Subject: RE: [PHP] Mail Function Problem From: a...@ashleysheridan.co.uk To: aj...@alumni.iu.edu CC: k...@daleco.biz; a.bovane...@gmail.com; php-general@lists.php.net Date: Tue, 13 Apr 2010 13:19:15 +0100 On Mon, 2010-04-12 at 12:25 -0400, Alice Wei wrote: Date: Mon, 12 Apr 2010 11:09:42 -0500 From: k...@daleco.biz To: aj...@alumni.iu.edu CC: a.bovane...@gmail.com; php-general@lists.php.net Subject: Re: [PHP] Mail Function Problem Alice Wei wrote: Hi! You have the following php.ini params:SMTP = smtp.live.com smtp_port = 587 live.com not support relay and it requires authentication. Is there an email account that I could try? I thought most email accounts requires authentication anyway. Well, therein lies the rub, as the Bard said (maybe). PHP's mail() was built on a general assumption that there would be a local SMTP server. It supports remote SMTP, but I'm not aware of any ability to do SMTP auth, even in the PEAR packages. You might just wanna read up on mail in general. The php.net/mail page lists several relevant RFC's, and has links to most of the PEAR mail classes, etc. You should definitely read up on live.com's email configuration. If they use SMTP auth, I'm not sure you can do this (per above). If it uses, say, POP before SMTP for authorization, you might be able to hack something together with the PHP IMAP functions, or even sockets, but you're getting into a big lotta work for what seems a small thing. This is what I am talking about. Two years ago when I first set up my own server with Linux and not Windows, I never had to deal with this. Perhaps the authentication has since then got stricter, but it should not be so much of a heck of a deal. I found this doc from ATT's website, http://helpme.att.net/pdf/uverse/uverse_hsi_qsg_english.pdf, so obviously the smtp server I provided earlier is probably not up to date. I think I will fiddle around with the php.ini file and see what else is there. Thanks. Alice _ Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1 Linux installations come with sendmail which allows you to send email directly. Windows doesn't have this as part of the base setup, but I believe if you can install a local mail server then this should fix the issue. Something like http://www.hmailserver.com/? I use ATT, why is it that I use their SMTP server and my From address in PHP.ini file didn't work? Thanks. Alice Thanks,sh http://www.ashleysheridan.co.uk _ Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1 That looks to do what you need. I don't really know of any specific other examples as it's been a while since I've used Windows for anything now. The link you gave did say it was free though, so you don't really have anything to lose by installing it. Thanks, Ash http://www.ashleysheridan.co.uk
Re: [PHP] Mail Function Problem
On 12 April 2010 05:22, Kevin Kinsey k...@daleco.biz wrote: Thanks to the worldwide brotherhood of crooks known as spammers, sending e-mail these days isn't nearly as easy as PHP makes it look. You might wanna look into an errors-to header to help debug any problems with sender authorization, bad ports, etc. Along these lines: there's a chance that sending a mail from yourself, to yourself, through PHP like this, will cause mail servers to think it's spam. For testing email sending, normal scenarios are better (i.e. send an email to another account). Regards Peter -- hype WWW: http://plphp.dk / http://plind.dk LinkedIn: http://www.linkedin.com/in/plind Flickr: http://www.flickr.com/photos/fake51 BeWelcome: Fake51 Couchsurfing: Fake51 /hype -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mail Function Problem
From: peter.e.l...@gmail.com Date: Mon, 12 Apr 2010 13:09:48 +0200 Subject: Re: [PHP] Mail Function Problem To: k...@daleco.biz CC: aj...@alumni.iu.edu; php-general@lists.php.net On 12 April 2010 05:22, Kevin Kinsey k...@daleco.biz wrote: Thanks to the worldwide brotherhood of crooks known as spammers, sending e-mail these days isn't nearly as easy as PHP makes it look. You might wanna look into an errors-to header to help debug any problems with sender authorization, bad ports, etc. Along these lines: there's a chance that sending a mail from yourself, to yourself, through PHP like this, will cause mail servers to think it's spam. For testing email sending, normal scenarios are better (i.e. send an email to another account). Regards Peter -- hype WWW: http://plphp.dk / http://plind.dk LinkedIn: http://www.linkedin.com/in/plind Flickr: http://www.flickr.com/photos/fake51 BeWelcome: Fake51 Couchsurfing: Fake51 /hype I have changed my $to to $email, so it is not the same email address as the $from. I also added Kevin's lines with the parameters that April suggested, and it looks like I still get Sending Mail failed. Which function should I use to find out why my sending mail failed? Thanks for your help. Alice _ The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmail. http://www.windowslive.com/campaign/thenewbusy?tile=multicalendarocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5
Re: [PHP] Mail Function Problem
Hi! You have the following php.ini params: SMTP = smtp.live.com smtp_port = 587 live.com not support relay and it requires authentication. On Mon, Apr 12, 2010 at 6:33 AM, Alice Wei aj...@alumni.iu.edu wrote: Hi, I have an issue here where I see no PHP errors on my mail function usage, and yet I am not getting the mail in the desired account. Here is what I have for my PHP code: $headers = From: aj...@alumni.iu.edu; $to = aj...@alumni.iu.edu ; $subject = Comments Regarding My Studio; $body = From: $your_name\n E-Mail: $email\n Reason Contact: $question\n Comments:\n $comments; mail($to, $subject, $body,$headers); This is what I have in my PHP.ini: [mail function] ; For Win32 only. SMTP = smtp.live.com smtp_port = 587 ; For Win32 only. sendmail_from = aj...@alumni.iu.edu ; For Unix only. You may supply arguments as well (default: sendmail -t -i). ;sendmail_path = ; Force the addition of the specified parameters to be passed as extra parameters ; to the sendmail binary. These parameters will always replace the value of ; the 5th parameter to mail(), even in safe mode. ;mail.force_extra_parameters = Yet, I don't see any mail in my aj...@alumni.iu.edu Mailbox, can anyone on the list please give me some pointers on what I may have done wrong here? Thanks for your help. _ The New Busy is not the old busy. Search, chat and e-mail from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_3 -- With regards, Alexei Bovanenko
RE: [PHP] Mail Function Problem
Date: Mon, 12 Apr 2010 15:26:46 +0400 Subject: Re: [PHP] Mail Function Problem From: a.bovane...@gmail.com To: aj...@alumni.iu.edu CC: php-general@lists.php.net Hi! You have the following php.ini params:SMTP = smtp.live.com smtp_port = 587 live.com not support relay and it requires authentication. Is there an email account that I could try? I thought most email accounts requires authentication anyway. Thanks for your help. Alice On Mon, Apr 12, 2010 at 6:33 AM, Alice Wei aj...@alumni.iu.edu wrote: Hi, I have an issue here where I see no PHP errors on my mail function usage, and yet I am not getting the mail in the desired account. Here is what I have for my PHP code: $headers = From: aj...@alumni.iu.edu; $to = aj...@alumni.iu.edu ; $subject = Comments Regarding My Studio; $body = From: $your_name\n E-Mail: $email\n Reason Contact: $question\n Comments:\n $comments; mail($to, $subject, $body,$headers); This is what I have in my PHP.ini: [mail function] ; For Win32 only. SMTP = smtp.live.com smtp_port = 587 ; For Win32 only. sendmail_from = aj...@alumni.iu.edu ; For Unix only. You may supply arguments as well (default: sendmail -t -i). ;sendmail_path = ; Force the addition of the specified parameters to be passed as extra parameters ; to the sendmail binary. These parameters will always replace the value of ; the 5th parameter to mail(), even in safe mode. ;mail.force_extra_parameters = Yet, I don't see any mail in my aj...@alumni.iu.edu Mailbox, can anyone on the list please give me some pointers on what I may have done wrong here? Thanks for your help. _ The New Busy is not the old busy. Search, chat and e-mail from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_3 -- With regards, Alexei Bovanenko _ The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmail. http://www.windowslive.com/campaign/thenewbusy?tile=multicalendarocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5
Re: [PHP] Mail Function Problem
Alice Wei wrote: Hi! You have the following php.ini params:SMTP = smtp.live.com smtp_port = 587 live.com not support relay and it requires authentication. Is there an email account that I could try? I thought most email accounts requires authentication anyway. Well, therein lies the rub, as the Bard said (maybe). PHP's mail() was built on a general assumption that there would be a local SMTP server. It supports remote SMTP, but I'm not aware of any ability to do SMTP auth, even in the PEAR packages. You might just wanna read up on mail in general. The php.net/mail page lists several relevant RFC's, and has links to most of the PEAR mail classes, etc. You should definitely read up on live.com's email configuration. If they use SMTP auth, I'm not sure you can do this (per above). If it uses, say, POP before SMTP for authorization, you might be able to hack something together with the PHP IMAP functions, or even sockets, but you're getting into a big lotta work for what seems a small thing. Kevin Kinsey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mail Function Problem
Date: Mon, 12 Apr 2010 11:09:42 -0500 From: k...@daleco.biz To: aj...@alumni.iu.edu CC: a.bovane...@gmail.com; php-general@lists.php.net Subject: Re: [PHP] Mail Function Problem Alice Wei wrote: Hi! You have the following php.ini params:SMTP = smtp.live.com smtp_port = 587 live.com not support relay and it requires authentication. Is there an email account that I could try? I thought most email accounts requires authentication anyway. Well, therein lies the rub, as the Bard said (maybe). PHP's mail() was built on a general assumption that there would be a local SMTP server. It supports remote SMTP, but I'm not aware of any ability to do SMTP auth, even in the PEAR packages. You might just wanna read up on mail in general. The php.net/mail page lists several relevant RFC's, and has links to most of the PEAR mail classes, etc. You should definitely read up on live.com's email configuration. If they use SMTP auth, I'm not sure you can do this (per above). If it uses, say, POP before SMTP for authorization, you might be able to hack something together with the PHP IMAP functions, or even sockets, but you're getting into a big lotta work for what seems a small thing. This is what I am talking about. Two years ago when I first set up my own server with Linux and not Windows, I never had to deal with this. Perhaps the authentication has since then got stricter, but it should not be so much of a heck of a deal. I found this doc from ATT's website, http://helpme.att.net/pdf/uverse/uverse_hsi_qsg_english.pdf, so obviously the smtp server I provided earlier is probably not up to date. I think I will fiddle around with the php.ini file and see what else is there. Thanks. Alice _ Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1
RE: [PHP] Mail Function Problem
On Mon, 2010-04-12 at 12:58 -0400, Alice Wei wrote: Hi, I found an article on the item you described. http://www.talkphp.com/vbarticles.php?do=articlearticleid=51title=sending-emails-with-the-zend-framework, but I am using Windows on my PHP. Would this still work? Looks like the example code it provided is from a Linux system. I also saw info. on this link: http://activecodeline.com/sending-emails-via-zend_mail-using-google-email-account. Since all the authentication is done here in one go, what should I edit on my PHP.ini file? Do I have to set the params as http://helpme.att.net/pdf/uverse/uverse_hsi_qsg_english.pdf is described? I use U-Verse from ATT, by by way. [mail function] ; For Win32 only. SMTP = smtp.att,yahoo.com smtp_port = 465 ; For Win32 only. sendmail_from = elite.engl...@att.net There's no need to edit anything in php.ini, and, since it is pure PHP, it should work on Windows too, though I didn't try it. It works well on Linux. Here's the class we used to send mail through Zend_Mail: ?php class Mail_Send { public function __construct($to_mail, $to_name, $subject, $body) { $config_general = Database_Config_General::getInstance (); $mail = new Zend_Mail(); $mail-setFrom($config_general-getSiteMailAddress(), $config_general-getSiteMailName()); $mail-addTo($to_mail, $to_name); $mail-setSubject($subject); $mail-setBodyText($body, UTF-8); $smtp_host = $config_general-getMailSendHost(); $smtp_authentication = $config_general-getMailSendAuthentication (); $smtp_user = $config_general-getMailSendUsername(); $smtp_password = $config_general-getMailSendPassword(); $smtp_security = $config_general-getMailSendSecurity(); $smtp_port = $config_general-getMailSendPort(); if ($smtp_host != ) { if ($smtp_authentication != None) { $config = array ('auth' = $smtp_authentication, 'username' = $smtp_user, 'password' = $smtp_password); $mta = new Zend_Mail_Transport_Smtp($smtp_host); } if ($smtp_security != NONE) { $config = array_merge ($config, array ('ssl' = $smtp_security)); } if ($smtp_port != ) { $config = array_merge ($config, array ('port' = $smtp_port)); } if (isset ($config)) { $mta = new Zend_Mail_Transport_Smtp($smtp_host, $config); } else { $mta = new Zend_Mail_Transport_Smtp($smtp_host); } $mail-send($mta); } else { // If no smtp host is given, it uses the default sendmail mail transport agent. $mail-send(); } } } ? Hope it works, Teus. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail Function Problem
PEAR's mail package does support authentication. http://email.about.com/od/emailprogrammingtips/qt/PHP_Email_SMTP_Authentication.htm In case you get a Sent Successfully message (but didn't get a mail in your inbox or spam folder) there is a problem with your SMTP server configuration. And There's no need to edit anything in php.ini, and, since it is pure PHP, it should work on Windows too (i tried it and it works) KK. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail Function Problem
kranthi wrote: PEAR's mail package does support authentication. http://email.about.com/od/emailprogrammingtips/qt/PHP_Email_SMTP_Authentication.htm I will say mea culpa on this one; apparently I didn't dig deep enough into the PEAR docs to figure this out. It's certainly not mentioned on the manpage at php.net, but, of course, the PEAR stuff is elsewhere. I read over the first page linked from the PHP manpage, so it must have been a lil' deeper than that. If it's only available at about.com (lol), I'd suggest filing a PR with the PEAR folk's documentation team, eh? But, this time I'll do what I shoulda mentioned before and include the IANAE disclaimer on all things PEAR, many things PHP, and some things SMTP. Kevin Kinsey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mail Function Problem
Hi, Thanks to everyone's suggestions, I have followed some instructions from http://www.geeksengine.com/article/install-pear-on-windows.html and attempted to install PEAR. The problem is, when I do a test page, which only has: ?php error_reporting(-1); require_once PEAR.php; ?. utor It only gives me a blank page, with no errors. Has anyone who succeeded with using PEAR on PHP can guide me on a good tutorial to read? Thanks for your help. Alice Date: Mon, 12 Apr 2010 15:54:05 -0500 From: k...@daleco.biz To: kranthi...@gmail.com CC: aj...@alumni.iu.edu; php-general@lists.php.net Subject: Re: [PHP] Mail Function Problem kranthi wrote: PEAR's mail package does support authentication. http://email.about.com/od/emailprogrammingtips/qt/PHP_Email_SMTP_Authentication.htm I will say mea culpa on this one; apparently I didn't dig deep enough into the PEAR docs to figure this out. It's certainly not mentioned on the manpage at php.net, but, of course, the PEAR stuff is elsewhere. I read over the first page linked from the PHP manpage, so it must nks ve been a lil' deeper than that. If it's only available at about.com (lol), I'd suggest filing a PR with the PEAR folk's documentation team, eh? But, this time I'll do what I shoulda mentioned before and include the IANAE disclaimer on all things PEAR, many things PHP, and some things SMTP. Kevin Kinsey _ The New Busy is not the old busy. Search, chat and e-mail from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_3
Re: [PHP] Mail Function Problem
Hi Alice, I have a sendmail script I wrote on my way to learning PHP. Uses PHP 4 i believe, maybe 5. Wrote it a while ago. You and anyone else are welcome to use it/modify. You can reference this php it from multiple forms. Just specify the form names it should accept and their parameters. It can also send HTML results with a little modification. It isn't necessarily set up for mass emailing, but with a little tweaking, I am sure you could get it to work. You can separate the emails with comas , currently and it will send to all of them, but if they are in the TO:, everyone will see everyones email address. Might set it up to send to your email in the TO: and use the BCC: to send to your users. If you do convert it, mind sharing back?? :)) HTH, http://designdrumm.com/sendmail_gen.php.zip Karl On Apr 12, 2010, at 5:31 PM, Alice Wei wrote: Hi, Thanks to everyone's suggestions, I have followed some instructions from http://www.geeksengine.com/article/install-pear-on-windows.html and attempted to install PEAR. The problem is, when I do a test page, which only has: ?php error_reporting(-1); require_once PEAR.php; ?. utor It only gives me a blank page, with no errors. Has anyone who succeeded with using PEAR on PHP can guide me on a good tutorial to read? Thanks for your help. Alice Date: Mon, 12 Apr 2010 15:54:05 -0500 From: k...@daleco.biz To: kranthi...@gmail.com CC: aj...@alumni.iu.edu; php-general@lists.php.net Subject: Re: [PHP] Mail Function Problem kranthi wrote: PEAR's mail package does support authentication. http://email.about.com/od/emailprogrammingtips/qt/ PHP_Email_SMTP_Authentication.htm I will say mea culpa on this one; apparently I didn't dig deep enough into the PEAR docs to figure this out. It's certainly not mentioned on the manpage at php.net, but, of course, the PEAR stuff is elsewhere. I read over the first page linked from the PHP manpage, so it must nks ve been a lil' deeper than that. If it's only available at about.com (lol), I'd suggest filing a PR with the PEAR folk's documentation team, eh? But, this time I'll do what I shoulda mentioned before and include the IANAE disclaimer on all things PEAR, many things PHP, and some things SMTP. Kevin Kinsey _ The New Busy is not the old busy. Search, chat and e-mail from your inbox. http://www.windowslive.com/campaign/thenewbusy? ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_3 Karl DeSaulniers Design Drumm http://designdrumm.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mail Function Problem
Date: Mon, 12 Apr 2010 15:54:05 -0500 From: k...@daleco.biz To: kranthi...@gmail.com CC: aj...@alumni.iu.edu; php-general@lists.php.net Subject: Re: [PHP] Mail Function Problem kranthi wrote: PEAR's mail package does support authentication. http://email.about.com/od/emailprogrammingtips/qt/PHP_Email_SMTP_Authentication.htm I will say mea culpa on this one; apparently I didn't dig deep enough into the PEAR docs to figure this out. It's certainly not mentioned on the manpage at php.net, but, of course, the PEAR stuff is elsewhere. I read over the first page linked from the PHP manpage, so it must have been a lil' deeper than that. If it's only available at about.com (lol), I'd suggest filing a PR with the PEAR folk's documentation team, eh? But, this time I'll do what I shoulda mentioned before and include the IANAE disclaimer on all things PEAR, many things PHP, and some things SMTP. Kevin Kinsey I tried installing the Pear Mail package, it is now located in php/PEAR/Mail, and my code is located in the htdocs. Here is the code: require_once(Mail.php); $mail = Mail::factory(mail); $your_name = $_POST['your_name']; $email = $_POST['email']; $question = $_POST['question']; $comments= $_POST['comments']; $submit = $_POST['submit']; if($_POST['submit']==Submit) { $from = elite.engl...@att.net; $to = $email; $subject = Comments Regarding HH Web Design Studio; $body = From: $your_name\n E-Mail: $email\n Reason Contact: $question\n Comments:\n $comments; $host = smtp.att.yahoo.com; $username = my_user_name; $password = password; $headers = array ('From' = $from, 'To' = $to, 'Subject' = $subject); $mail-send($to, $headers, $body); if (PEAR::isError($mail)) echo p . $mail-getMessage() . /p; This is what I get: Fatal error: Class 'Mail' not found in C:\xampp\htdocs\Alice.Wei\web\mail.php on line 30 Do I need to move the Mail PEAR class to the same folder as my web folder? How can I make sure that my Pear is running? Thanks for your help. Alice _ The New Busy is not the too busy. Combine all your e-mail accounts with Hotmail. http://www.windowslive.com/campaign/thenewbusy?tile=multiaccountocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_4
Re: [PHP] Mail Function Problem
thats weired... Mail.php contains the class Mail. So getting a class not found error is not possible... (require_once stops the script in case it can't find Mail.php) Do I need to move the Mail PEAR class to the same folder as my web folder ensure that C:/xampp/php/PEAR folder is added to your include list -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mail Function Problem
From: kranthi...@gmail.com Date: Tue, 13 Apr 2010 07:41:19 +0530 Subject: Re: [PHP] Mail Function Problem To: aj...@alumni.iu.edu CC: k...@daleco.biz; php-general@lists.php.net thats weired... Mail.php contains the class Mail. So getting a class not found error is not possible... (require_once stops the script in case it can't find Mail.php) Do I need to move the Mail PEAR class to the same folder as my web folder ensure that C:/xampp/php/PEAR folder is added to your include list I thought so too, this is what I have in my php.ini: ; PHP's default setting for include_path is .;/path/to/php/pear ; http://php.net/include-path include_path = .;C:\xampp\php\PEAR This is the contents of my C:\xampp\php\PEAR\Mail: mail.php mime.php mimeDecode.php mimePart.php null.php RFC822.php sendmail.php smtp.php Unless, I have to do require_once(mail.php)? I am getting confused. Alice _ Hotmail is redefining busy with tools for the New Busy. Get more from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_2
Re: [PHP] Mail Function Problem
Hey Alice, Try throwing the MIME in. Sometimes messages get thrown in an abyss if they don't know the MIME version or content type of an email. They think its spam and so you wouldn't get an error message on your end. Just no email. $headers = 'MIME-Version: 1.0' . \r\n; $headers .= 'Content-type: text/html; charset=utf-8' . \r\n; Karl On Apr 12, 2010, at 10:24 PM, Alice Wei wrote: From: kranthi...@gmail.com Date: Tue, 13 Apr 2010 07:41:19 +0530 Subject: Re: [PHP] Mail Function Problem To: aj...@alumni.iu.edu CC: k...@daleco.biz; php-general@lists.php.net thats weired... Mail.php contains the class Mail. So getting a class not found error is not possible... (require_once stops the script in case it can't find Mail.php) Do I need to move the Mail PEAR class to the same folder as my web folder ensure that C:/xampp/php/PEAR folder is added to your include list I thought so too, this is what I have in my php.ini: ; PHP's default setting for include_path is .;/path/to/php/pear ; http://php.net/include-path include_path = .;C:\xampp\php\PEAR This is the contents of my C:\xampp\php\PEAR\Mail: mail.php mime.php mimeDecode.php mimePart.php null.php RFC822.php sendmail.php smtp.php Unless, I have to do require_once(mail.php)? I am getting confused. Alice _ Hotmail is redefining busy with tools for the New Busy. Get more from your inbox. http://www.windowslive.com/campaign/thenewbusy? ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_2 Karl DeSaulniers Design Drumm http://designdrumm.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail Function Problem
when you install pear package Mail a file called Mail.php will be installed into C:/xampp/php/PEAR Mail.php contains the class Mail. So getting a class not found error is not possible.. are you sure you are doing require_once 'Mail.php' ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail Function Problem
Alice Wei wrote: Hi, I have an issue here where I see no PHP errors on my mail function usage, and yet I am not getting the mail in the desired account. Here is what I have for my PHP code: $headers = From: aj...@alumni.iu.edu; $to = aj...@alumni.iu.edu ; $subject = Comments Regarding My Studio; $body = From: $your_name\n E-Mail: $email\n Reason Contact: $question\n Comments:\n $comments; mail($to, $subject, $body,$headers); I don't see any way for you to know if there are any errors. Try this as a very basic start: $headers = From: aj...@alumni.iu.edu; $to = aj...@alumni.iu.edu ; $subject = Comments Regarding My Studio; $body = From: $your_name\n E-Mail: $email\n Reason Contact: $question\n Comments:\n $comments; $success=mail($to, $subject, $body,$headers); if ($success) { echo Mail was sent successfully!; } else { echo Sending of mail failed!; } This is what I have in my PHP.ini: [mail function] ; For Win32 only. SMTP = smtp.live.com smtp_port = 587 ; For Win32 only. sendmail_from = aj...@alumni.iu.edu ; For Unix only. You may supply arguments as well (default: sendmail -t -i). ;sendmail_path = ; Force the addition of the specified parameters to be passed as extra parameters ; to the sendmail binary. These parameters will always replace the value of ; the 5th parameter to mail(), even in safe mode. ;mail.force_extra_parameters = Yet, I don't see any mail in my aj...@alumni.iu.edu Mailbox, can anyone on the list please give me some pointers on what I may have done wrong here? Thanks for your help. Thanks to the worldwide brotherhood of crooks known as spammers, sending e-mail these days isn't nearly as easy as PHP makes it look. You might wanna look into an errors-to header to help debug any problems with sender authorization, bad ports, etc. HTH, KDK -- 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, [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
Re: [PHP] mail() function problem
I'm developing uner Windows at home .. but I'm pretty sure that my host is running Unix or Unix like systems on their machines Pahlevanzadeh Mohsen [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Please install a mailserver until your SMTP server will be up. When your SMTP server is down,mail func doesn't work. My suggesstion: Please work under UNIX systems. Yours,Mohsen --- Dre [EMAIL PROTECTED] wrote: Hi I was trying to use the mail() function, but it did not work, maybe because of some settings problem or something that I can't figure out I went online and tried to execute the following //=== ?php $from = $_POST['from']; $subject = $_POST['subject']; $content = $_POST['content']; $to = [EMAIL PROTECTED]; $headers = From:.$from; if(mail($to, $subject, $content, From: $from)) { echosent; } else{ echo not sent; } ? //=== the variable values sent from a Form in another and they are sent correctly but I keep having this error //=== Warning: mail(): Failed to connect to mailserver at localhost port 25, verify your SMTP and smtp_port setting in php.ini or use ini_set() in C:\Program Files\Apache Group\Apache2\htdocs\mysite/myfile.php on line 194 //=== my php.ini settings for the mail function are //= [mail function] ; For Win32 only. SMTP = localhost smtp_port = 25 sendmail_from = [EMAIL PROTECTED] //= thanks in advance Dre, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php = -DIGITAL SIGNATURE--- ///Mohsen Pahlevanzadeh Network administrator programmer My home phone is: +98213810146 My email address is m_pahlevanzadeh at yahoo dot com My website is: http://webnegar.net __ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() function problem
Please install a mailserver until your SMTP server will be up. When your SMTP server is down,mail func doesn't work. My suggesstion: Please work under UNIX systems. Yours,Mohsen --- Dre [EMAIL PROTECTED] wrote: Hi I was trying to use the mail() function, but it did not work, maybe because of some settings problem or something that I can't figure out I went online and tried to execute the following //=== ?php $from = $_POST['from']; $subject = $_POST['subject']; $content = $_POST['content']; $to = [EMAIL PROTECTED]; $headers = From:.$from; if(mail($to, $subject, $content, From: $from)) { echosent; } else{ echo not sent; } ? //=== the variable values sent from a Form in another and they are sent correctly but I keep having this error //=== Warning: mail(): Failed to connect to mailserver at localhost port 25, verify your SMTP and smtp_port setting in php.ini or use ini_set() in C:\Program Files\Apache Group\Apache2\htdocs\mysite/myfile.php on line 194 //=== my php.ini settings for the mail function are //= [mail function] ; For Win32 only. SMTP = localhost smtp_port = 25 sendmail_from = [EMAIL PROTECTED] //= thanks in advance Dre, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php = -DIGITAL SIGNATURE--- ///Mohsen Pahlevanzadeh Network administrator programmer My home phone is: +98213810146 My email address is m_pahlevanzadeh at yahoo dot com My website is: http://webnegar.net __ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() function problem
On Wed, Sep 01, 2004 at 06:09:04PM +0300, Dre wrote: Hi I was trying to use the mail() function, but it did not work, maybe because of some settings problem or something that I can't figure out I went online and tried to execute the following //=== ?php $from = $_POST['from']; $subject = $_POST['subject']; $content = $_POST['content']; $to = [EMAIL PROTECTED]; $headers = From:.$from; if(mail($to, $subject, $content, From: $from)) { echosent; } else{ echo not sent; } ? //=== the variable values sent from a Form in another and they are sent correctly but I keep having this error //=== Warning: mail(): Failed to connect to mailserver at localhost port 25, verify your SMTP and smtp_port setting in php.ini or use ini_set() in C:\Program Files\Apache Group\Apache2\htdocs\mysite/myfile.php on line 194 //=== my php.ini settings for the mail function are //= [mail function] ; For Win32 only. SMTP = localhost smtp_port = 25 sendmail_from = [EMAIL PROTECTED] //= thanks in advance Dre, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Hmm. Your php.ini says that the smtp server is on localhost. The error message says that the system can't connect to an smtp server on localhost. Perhaps your smtp server is really at your ISP, say smtp.yourisp.com. -- Jim Kaufman Linux Evangelist public key 0x6D802619 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail function problem
changing the value in the php.ini file is not the ideal option, as it screws things up for all of users/scripts on the server. you could use ini_set() for the script to change the sendmail_path var for that script. you could use a mail class that does alot of the grunt work for you (Manuel Lemos normally posts some classes from his site, however I use PHPMailer (http://phpmailer.sourceforge.net) and have never looked back. On Fri, 2003-05-30 at 03:26, David Grant wrote: Bersani Francesco wrote: Hi, I have a problem with the mail function; it always sends mails assuming in the from field the user [EMAIL PROTECTED]. I tried to override it with this code: ? $email = [EMAIL PROTECTED]; $subject = prova invio mail ; $message = parappaaa ; $headers = From:[EMAIL PROTECTED]:[EMAIL PROTECTED]; mail($email, $subject, $message, $headers); ? -- It doesn't work... Can anybody help me ? Take a peek into php.ini to change the default value. Note that you should seperate mail headers with \r\n. Regards, David -- David Grant Web Developer [EMAIL PROTECTED] http://www.wiredmedia.co.uk Tel: 0117 930 4365, Fax: 0870 169 7625 Wired Media Ltd Registered Office: 43 Royal Park, Bristol, BS8 3AN Studio: Whittakers House, 32 - 34 Hotwell Road, Bristol, BS8 4UD Company registration number: 4016744 ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** -- Michael Geier [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail function problem
Bersani Francesco wrote: Hi, I have a problem with the mail function; it always sends mails assuming in the from field the user [EMAIL PROTECTED]. I tried to override it with this code: ? $email = [EMAIL PROTECTED]; $subject = prova invio mail ; $message = parappaaa ; $headers = From:[EMAIL PROTECTED]:[EMAIL PROTECTED]; mail($email, $subject, $message, $headers); ? -- It doesn't work... Can anybody help me ? Take a peek into php.ini to change the default value. Note that you should seperate mail headers with \r\n. Regards, David -- David Grant Web Developer [EMAIL PROTECTED] http://www.wiredmedia.co.uk Tel: 0117 930 4365, Fax: 0870 169 7625 Wired Media Ltd Registered Office: 43 Royal Park, Bristol, BS8 3AN Studio: Whittakers House, 32 - 34 Hotwell Road, Bristol, BS8 4UD Company registration number: 4016744 ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail() function problem
Hi, does that mean I can do nothing about it? Alva Pekka Saarinen [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... At 9/10/2002, you wrote: Hi Everyone, I did a simple test with this script: ?php mail([EMAIL PROTECTED], test, this is a test mail); echo done; ? I run the script from web accounts on different servers. I can receive the test mail from some but not from others. Is there any configurations that I am missing here? My guesses: Many mail servers are configured so that they send mail only if the sender receives mail at the same time. One other possible pitfall is that reverse IP lookup is not working correctly and your server rejects the mail as it cannot verify the sender host. Also, many (well configured) servers do not send when there is no live account for that sender. - Pekka Saarinen http://photography-on-the.net - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail() function problem
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... Hi, does that mean I can do nothing about it? Alva Pekka Saarinen [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... At 9/10/2002, you wrote: Hi Everyone, I did a simple test with this script: ?php mail([EMAIL PROTECTED], test, this is a test mail); echo done; ? I run the script from web accounts on different servers. I can receive the test mail from some but not from others. Is there any configurations that I am missing here? My guesses: Many mail servers are configured so that they send mail only if the sender receives mail at the same time. One other possible pitfall is that reverse IP lookup is not working correctly and your server rejects the mail as it cannot verify the sender host. Also, many (well configured) servers do not send when there is no live account for that sender. You can use the fourth argument to mail() to set additional headers, such as From: [EMAIL PROTECTED] to try and get around the problem. -- David Robley A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail() function problem
At 9/10/2002, you wrote: Hi Everyone, I did a simple test with this script: ?php mail([EMAIL PROTECTED], test, this is a test mail); echo done; ? I run the script from web accounts on different servers. I can receive the test mail from some but not from others. Is there any configurations that I am missing here? My guesses: Many mail servers are configured so that they send mail only if the sender receives mail at the same time. One other possible pitfall is that reverse IP lookup is not working correctly and your server rejects the mail as it cannot verify the sender host. Also, many (well configured) servers do not send when there is no live account for that sender. - Pekka Saarinen http://photography-on-the.net - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mail() function problem
Dear Arul friends, thanks for your kind helps, but the problem still exists. the actual problem is that the 2nd mail() function does not ever send the mail, no matter what the destination and the additional header is. is there a way to debug this problem? thanks Daniel # -Original Message- # From: Arul Venkatesh Kandaswamy [mailto:[EMAIL PROTECTED]] # Sent: Saturday, August 31, 2002 17:07 # To: Akhmad D. Sembiring # Subject: Re: [PHP] mail() function problem # # # Hello # # $from = MIME-Version: 1.0\r\n; # $from .= Content-type: text/html; charset=iso-8859-1\r\n; # $from .= From: [EMAIL PROTECTED]\r\n; # $subject=Registration Confirmation; # $messge=test mail; # mail($mailid,$subject,$message,$from); # # Thanks and Regards # Arul venki # # - Original Message - # From: Akhmad D. Sembiring [EMAIL PROTECTED] # To: [EMAIL PROTECTED] # Sent: Saturday, August 31, 2002 2:02 PM # Subject: [PHP] mail() function problem # # # Dear All, # # I have a little problem with mail() function, # # PHP Code: # # -- # mail($email, Membership ok, $themsg, # From: [EMAIL PROTECTED]\r\n); # # mail([EMAIL PROTECTED], # , , From: $email\r\n); # -- # # Why does the second mail() function did not ever send the email to # yahoogroups? # # I wonder, can the mail() function be put in a loop structure (that # traverse # an array of emails) and send all emails successfully? # # Thanks for your advice, # # Daniel --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.381 / Virus Database: 214 - Release Date: 8/2/02 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() function problem
Hello, On 09/03/2002 12:19 AM, Akhmad D. Sembiring wrote: Dear Arul friends, thanks for your kind helps, but the problem still exists. the actual problem is that the 2nd mail() function does not ever send the mail, no matter what the destination and the additional header is. is there a way to debug this problem? Most likely you have not configured PHP to use the mail() properly. First things first. Which platform are you using? Did you configure php.ini mail options for your platform? what does var_dump(mail(you arguments here)); return? -- Regards, Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mail() function problem
# On 09/03/2002 12:19 AM, Akhmad D. Sembiring wrote: # Dear Arul friends, # # thanks for your kind helps, # but the problem still exists. # # the actual problem is that the 2nd mail() function # does not ever send the mail, no matter what the destination # and the additional header is. # # is there a way to debug this problem? # # Most likely you have not configured PHP to use the mail() properly. # First things first. Which platform are you using? # Did you configure php.ini mail options for your platform? unfortunately, the script is hosted on a hosting server so I don't have access to the php.ini file # what does var_dump(mail(you arguments here)); return? bool(true) thanks Daniel --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.381 / Virus Database: 214 - Release Date: 8/2/02 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() function problem
Hello, On 09/03/2002 12:38 AM, Akhmad D. Sembiring wrote: # thanks for your kind helps, # but the problem still exists. # # the actual problem is that the 2nd mail() function # does not ever send the mail, no matter what the destination # and the additional header is. # # is there a way to debug this problem? # # Most likely you have not configured PHP to use the mail() properly. # First things first. Which platform are you using? # Did you configure php.ini mail options for your platform? unfortunately, the script is hosted on a hosting server so I don't have access to the php.ini file But can't you tell if is it Windows or Unix/Linux? -- Regards, Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() function problem
I think mailing list managers like Yahoo, ezmlm, etc all have features in them to suspect bots and programs from subscribing/posting to the groups. I know I've had trouble subscribing/posting to groups managed by ezmlm... Probably there is a header or two that PHP automatically sets which makes the mailing lists suspicious... or something!! I don't know enough about email to really come up with an answer!!! You could try setting some headers similar to what your email client sets, to see if it's something missing... or try sending yourself an email from a php script and analysing the headers it sets. It could also be the lack of a return address or something similar that throws the lists off too. Justin on 31/08/02 6:32 PM, Akhmad D. Sembiring ([EMAIL PROTECTED]) wrote: Dear All, I have a little problem with mail() function, PHP Code: -- mail($email, Membership ok, $themsg, From: [EMAIL PROTECTED]\r\n); mail([EMAIL PROTECTED], , , From: $email\r\n); -- Why does the second mail() function did not ever send the email to yahoogroups? I wonder, can the mail() function be put in a loop structure (that traverse an array of emails) and send all emails successfully? Thanks for your advice, Daniel --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.381 / Virus Database: 214 - Release Date: 8/2/02 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mail() function problem
Most mailing lists reject mail if the Subject is blank. That would probably explain why your subjectless 2nd example is disappearing into the void. Dave -Original Message- From: Justin French [mailto:[EMAIL PROTECTED]] Sent: Saturday, August 31, 2002 3:20 AM To: Akhmad D. Sembiring; [EMAIL PROTECTED] Subject: Re: [PHP] mail() function problem I think mailing list managers like Yahoo, ezmlm, etc all have features in them to suspect bots and programs from subscribing/posting to the groups. I know I've had trouble subscribing/posting to groups managed by ezmlm... Probably there is a header or two that PHP automatically sets which makes the mailing lists suspicious... or something!! I don't know enough about email to really come up with an answer!!! You could try setting some headers similar to what your email client sets, to see if it's something missing... or try sending yourself an email from a php script and analysing the headers it sets. It could also be the lack of a return address or something similar that throws the lists off too. Justin on 31/08/02 6:32 PM, Akhmad D. Sembiring ([EMAIL PROTECTED]) wrote: Dear All, I have a little problem with mail() function, PHP Code: -- mail($email, Membership ok, $themsg, From: [EMAIL PROTECTED]\r\n); mail([EMAIL PROTECTED], , , From: $email\r\n); -- Why does the second mail() function did not ever send the email to yahoogroups? I wonder, can the mail() function be put in a loop structure (that traverse an array of emails) and send all emails successfully? Thanks for your advice, Daniel --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.381 / Virus Database: 214 - Release Date: 8/2/02 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail() function problem
On Wednesday 03 July 2002 00:52, Balaji Ankem wrote: I am using the SMTP server which needs authentication. I don't think the built-in mail command handles authentication. Google php smtp auth that should point you in the right direction. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* The Osmonds! You are all Osmonds!! Throwing up on a freeway at dawn!!! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php