[PHP] mail() function on Windows (WAMP Server)
I'm in the process of helping some developers port their php application from Linux to Windows (I know, string me up from the flag pole later). I have setup WAMP and everything is working fine with the exception of the mail() function. The code was originally developed on Linux and leveraged sendmail for the mail() function. What can I do to allow the php code to send mail from Windows? I have already tried installing the IIS SMTP service and that has not worked so far. The Windows box is Server 2008 R2 Standard, so IIS is 7.5 with the IIS 6.0 SMTP component.
Re: [PHP] mail() function on Windows (WAMP Server)
On Thu, Jan 6, 2011 at 15:27, David Armstrong darmstrong...@gmail.com wrote: I'm in the process of helping some developers port their php application from Linux to Windows (I know, string me up from the flag pole later). I have setup WAMP and everything is working fine with the exception of the mail() function. The code was originally developed on Linux and leveraged sendmail for the mail() function. What can I do to allow the php code to send mail from Windows? I have already tried installing the IIS SMTP service and that has not worked so far. The Windows box is Server 2008 R2 Standard, so IIS is 7.5 with the IIS 6.0 SMTP component. Did you update your php.ini on the WIMP/WAMP box to use SMTPm and to properly configure it for the server? -- /Daniel P. Brown Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() function on Windows (WAMP Server)
On Thu, Jan 6, 2011 at 15:50, David Armstrong darmstrong...@gmail.com wrote: I set the following parameters [mail function] ; For Win32 only. ; http://php.net/smtp SMTP = localhost ; http://php.net/smtp-port smtp_port = 25 sendmail_from = valid account here Per list rules, please hit reply-all and post your response below the quoted email in the future. Thanks. Did you set these as such before or after you last tested? And did you restart Apache/IIS after saving your changes to the php.ini file? And lastly, are you certain you edited the correct php.ini file? If accessing the script via the web, check out the Configuration File Path and, specifically, the Loaded Configuration File entries in your phpinfo() output. -- /Daniel P. Brown Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() function on Windows (WAMP Server)
I modified the php.ini in both the apache/bin directory, and also the php directory. Is there some way to get a trace of the code execution? The SMTP log files are completely worthless. They do not show any sort of connection attempt. On Thu, Jan 6, 2011 at 12:58 PM, Daniel Brown danbr...@php.net wrote: On Thu, Jan 6, 2011 at 15:50, David Armstrong darmstrong...@gmail.com wrote: I set the following parameters [mail function] ; For Win32 only. ; http://php.net/smtp SMTP = localhost ; http://php.net/smtp-port smtp_port = 25 sendmail_from = valid account here Per list rules, please hit reply-all and post your response below the quoted email in the future. Thanks. Did you set these as such before or after you last tested? And did you restart Apache/IIS after saving your changes to the php.ini file? And lastly, are you certain you edited the correct php.ini file? If accessing the script via the web, check out the Configuration File Path and, specifically, the Loaded Configuration File entries in your phpinfo() output. -- /Daniel P. Brown Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/
Re: [PHP] mail() function on Windows (WAMP Server)
On Thu, Jan 6, 2011 at 16:02, David Armstrong darmstrong...@gmail.com wrote: I modified the php.ini in both the apache/bin directory, and also the php directory. Is there some way to get a trace of the code execution? The SMTP log files are completely worthless. They do not show any sort of connection attempt. Per list rules, please hit reply-all and post your response below the quoted email in the future. Thanks. You can do a debug_print_backtrace()[1] call right after the call to mail(), or you can use a profiler like Xdebug[2]. You can also check the Apache error log to see if anything popped up. It'll be more helpful if you have error_reporting set to E_ALL, mind you. If you just want to see if mail() is encountering any errors itself, wrap the call in an `if` condition block: ?php if (!mail($to,$subject,$body,$headers)) { die('Call to mail() failed in '.__FILE__.'#'.(__LINE__ - 1).'.'.PHP_EOL); } ? -- /Daniel P. Brown Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() function on Windows (WAMP Server)
Thanks Daniel. I will suggest that to the developer and see if we can get some useful information to further the troubleshooting process. On Thu, Jan 6, 2011 at 1:08 PM, Daniel Brown danbr...@php.net wrote: On Thu, Jan 6, 2011 at 16:02, David Armstrong darmstrong...@gmail.com wrote: I modified the php.ini in both the apache/bin directory, and also the php directory. Is there some way to get a trace of the code execution? The SMTP log files are completely worthless. They do not show any sort of connection attempt. Per list rules, please hit reply-all and post your response below the quoted email in the future. Thanks. You can do a debug_print_backtrace()[1] call right after the call to mail(), or you can use a profiler like Xdebug[2]. You can also check the Apache error log to see if anything popped up. It'll be more helpful if you have error_reporting set to E_ALL, mind you. If you just want to see if mail() is encountering any errors itself, wrap the call in an `if` condition block: ?php if (!mail($to,$subject,$body,$headers)) { die('Call to mail() failed in '.__FILE__.'#'.(__LINE__ - 1).'.'.PHP_EOL); } ? -- /Daniel P. Brown Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/
Re: [PHP] mail() function on Windows (WAMP Server)
On Thu, Jan 6, 2011 at 16:10, David Armstrong darmstrong...@gmail.com wrote: Thanks Daniel. I will suggest that to the developer and see if we can get some useful information to further the troubleshooting process. Per list rules, please hit reply-all and post your response below the quoted email in the future. Thanks. You bet. Sorry about the missing references from the other email, by the way. I was on the phone and clicked Send a bit too hastily. ^1: http://php.net/debug_print_backtrace ^2: http://xdebug.org/ -- /Daniel P. Brown Network Infrastructure Manager Documentation, Webmaster Teams http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail Function Using PEAR Issues
On 21 April 2010 04:25, Alice Wei aj...@alumni.iu.edu wrote: Well, from my experience with Ubuntu, looks like that it does not do that. Unless, I am doing it wrong? So did you try using the 'smtp' backend and passing all the connection details rather than 'mail'? -- 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 Using PEAR Issues
The PEAR Mail package does not fall back from one mechanism to another if the first fails. On Tue, Apr 20, 2010 at 9:16 PM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: On Tue, 2010-04-20 at 22:17 +0200, Peter Lind wrote: On 20 April 2010 20:17, Alice Wei aj...@alumni.iu.edu wrote: From: peter.e.l...@gmail.com Date: Mon, 19 Apr 2010 10:15:08 +0200 Subject: Re: [PHP] Mail Function Using PEAR Issues To: aj...@alumni.iu.edu CC: php-general@lists.php.net Most, if not all, mail servers keep log files. You should look for the log files to see if the mail server has sent your mail properly or is experiencing problems (those may not feed back into PHP). 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 You know where I can find that? I use Evolution Mail, a mail server? I found it through Ubuntu yesterday. Here is the link: http://projects.gnome.org/evolution/ It asks me to put in the type of mail service I used, it grabbed Google, which is smtp.google.com. I still cannot send mail. I start to wonder what is going on. Alice Evolution is a mail client, not a mail server. Apart from that, you're using the 'mail' (PHPs mail function) as the backend mailer in your PEAR script - try using smtp instead and pass the SMTP config data you normally use. Have a look at http://pear.php.net/manual/en/package.mail.mail.factory.php - the smtp part. 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 If you've got Pear on Ubuntu, can Pear not default to sendmail if no SMTP connection is set up? Thanks, Ash http://www.ashleysheridan.co.uk -- http://blogs.linux.ie/kenguest/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mail Function Using PEAR Issues
From: peter.e.l...@gmail.com Date: Wed, 21 Apr 2010 09:29:19 +0200 Subject: Re: [PHP] Mail Function Using PEAR Issues To: aj...@alumni.iu.edu CC: a...@ashleysheridan.co.uk; php-general@lists.php.net On 21 April 2010 04:25, Alice Wei aj...@alumni.iu.edu wrote: Well, from my experience with Ubuntu, looks like that it does not do that. Unless, I am doing it wrong? So did you try using the 'smtp' backend and passing all the connection details rather than 'mail'? I have mentioned several posts earlier that I have done nothing about my php.ini file. From what you said, since I use U-Verse, am I supposed to do something as described here: http://helpme.att.net/pdf/uverse/uverse_hsi_qsg_english.pdf I thought with PEAR, you don't need to do that anymore. Or, am I wrong? 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 Using PEAR Issues
Date: Wed, 21 Apr 2010 22:01:03 +0200 Subject: Re: [PHP] Mail Function Using PEAR Issues To: aj...@alumni.iu.edu CC: a...@ashleysheridan.co.uk; php-general@lists.php.net On 21 April 2010 21:58, Alice Wei aj...@alumni.iu.edu wrote: From: peter.e.l...@gmail.com Date: Wed, 21 Apr 2010 21:51:31 +0200 Subject: Re: [PHP] Mail Function Using PEAR Issues To: aj...@alumni.iu.edu CC: a...@ashleysheridan.co.uk; php-general@lists.php.net On 21 April 2010 18:44, Alice Wei aj...@alumni.iu.edu wrote: I have mentioned several posts earlier that I have done nothing about my php.ini file. From what you said, since I use U-Verse, am I supposed to do something as described here: http://helpme.att.net/pdf/uverse/uverse_hsi_qsg_english.pdf I thought with PEAR, you don't need to do that anymore. Or, am I wrong? Read the PEAR documentation: http://pear.php.net/manual/en/package.mail.mail.factory.php You can use other backends than just 'mail' - try using the smtp and fill in your smtp settings as needed. Regards Peter I saw something like that on http://email.about.com/od/emailprogrammingtips/qt/PHP_Email_SMTP_Authentication.htm, and this is probably what you are talking about? $smtp = Mail::factory('smtp', array ('host' = $host, 'auth' = true, 'username' = $username, 'password' = $password)); Do I still need to install a mail server? I have Evolution Mail on my Linux box, and looks like that is a client and not a server. Or, can I use any of the mail smtp setup, like Google? Or, do use some authentication information from http://helpme.att.net/pdf/uverse/uverse_hsi_qsg_english.pdf, since I use U-Verse at home? Yes, the example you provide is the right direction - you can put in the smtp details you use to connect from Evolution to GMail, you don't need to setup a separate smtp server on your system. Regards Peter Well, hold it. I have edited my code to hold the information as we have discussed earlier, and this is the error I have now: Warning: include_once(Net/SMTP.php) [function.include-once]: failed to open stream: No such file or directory in /usr/share/php/Mail/smtp.php on line 348 Warning: include_once() [function.include]: Failed opening 'Net/SMTP.php' for inclusion (include_path='.:/usr/share/php') in /usr/share/php/Mail/smtp.php on line 348 Fatal error: Class 'Net_SMTP' not found in /usr/share/php/Mail/smtp.php on line 349 I am not sure what this means. If I have installed pear correctly, what else do I have to do here? I can see that I have some significant error messages than not getting anything at all. Thanks for your help. 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 Using PEAR Issues
you have to install the net_smtp package, simply with this command: $ pear install net_smtp-1.4.2 (which will explicitly install version 1.4.2 of Net_SMTP) If that doesn't work. for whatever reason, you could download the package manually from http://pear.php.net/package/Net_SMTP/download and install it by hand; though for reasons I've outlined in a previous post to this list I'd suggest you use the pear installer. On Thu, Apr 22, 2010 at 12:12 AM, Alice Wei aj...@alumni.iu.edu wrote: Date: Wed, 21 Apr 2010 22:01:03 +0200 Subject: Re: [PHP] Mail Function Using PEAR Issues To: aj...@alumni.iu.edu CC: a...@ashleysheridan.co.uk; php-general@lists.php.net On 21 April 2010 21:58, Alice Wei aj...@alumni.iu.edu wrote: From: peter.e.l...@gmail.com Date: Wed, 21 Apr 2010 21:51:31 +0200 Subject: Re: [PHP] Mail Function Using PEAR Issues To: aj...@alumni.iu.edu CC: a...@ashleysheridan.co.uk; php-general@lists.php.net On 21 April 2010 18:44, Alice Wei aj...@alumni.iu.edu wrote: I have mentioned several posts earlier that I have done nothing about my php.ini file. From what you said, since I use U-Verse, am I supposed to do something as described here: http://helpme.att.net/pdf/uverse/uverse_hsi_qsg_english.pdf I thought with PEAR, you don't need to do that anymore. Or, am I wrong? Read the PEAR documentation: http://pear.php.net/manual/en/package.mail.mail.factory.php You can use other backends than just 'mail' - try using the smtp and fill in your smtp settings as needed. Regards Peter I saw something like that on http://email.about.com/od/emailprogrammingtips/qt/PHP_Email_SMTP_Authentication.htm, and this is probably what you are talking about? $smtp = Mail::factory('smtp', array ('host' = $host, 'auth' = true, 'username' = $username, 'password' = $password)); Do I still need to install a mail server? I have Evolution Mail on my Linux box, and looks like that is a client and not a server. Or, can I use any of the mail smtp setup, like Google? Or, do use some authentication information from http://helpme.att.net/pdf/uverse/uverse_hsi_qsg_english.pdf, since I use U-Verse at home? Yes, the example you provide is the right direction - you can put in the smtp details you use to connect from Evolution to GMail, you don't need to setup a separate smtp server on your system. Regards Peter Well, hold it. I have edited my code to hold the information as we have discussed earlier, and this is the error I have now: Warning: include_once(Net/SMTP.php) [function.include-once]: failed to open stream: No such file or directory in /usr/share/php/Mail/smtp.php on line 348 Warning: include_once() [function.include]: Failed opening 'Net/SMTP.php' for inclusion (include_path='.:/usr/share/php') in /usr/share/php/Mail/smtp.php on line 348 Fatal error: Class 'Net_SMTP' not found in /usr/share/php/Mail/smtp.php on line 349 I am not sure what this means. If I have installed pear correctly, what else do I have to do here? I can see that I have some significant error messages than not getting anything at all. Thanks for your help. 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 -- http://blogs.linux.ie/kenguest/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mail Function Using PEAR Issues
Date: Thu, 22 Apr 2010 00:31:04 +0100 Subject: Re: [PHP] Mail Function Using PEAR Issues From: k...@linux.ie To: aj...@alumni.iu.edu CC: peter.e.l...@gmail.com; a...@ashleysheridan.co.uk; php-general@lists.php.net you have to install the net_smtp package, simply with this command: $ pear install net_smtp-1.4.2 (which will explicitly install version 1.4.2 of Net_SMTP) If that doesn't work. for whatever reason, you could download the package manually from http://pear.php.net/package/Net_SMTP/download and install it by hand; though for reasons I've outlined in a previous post to this list I'd suggest you use the pear installer. On Thu, Apr 22, 2010 at 12:12 AM, Alice Wei aj...@alumni.iu.edu wrote: Date: Wed, 21 Apr 2010 22:01:03 +0200 Subject: Re: [PHP] Mail Function Using PEAR Issues To: aj...@alumni.iu.edu CC: a...@ashleysheridan.co.uk; php-general@lists.php.net On 21 April 2010 21:58, Alice Wei aj...@alumni.iu.edu wrote: From: peter.e.l...@gmail.com Date: Wed, 21 Apr 2010 21:51:31 +0200 Subject: Re: [PHP] Mail Function Using PEAR Issues To: aj...@alumni.iu.edu CC: a...@ashleysheridan.co.uk; php-general@lists.php.net On 21 April 2010 18:44, Alice Wei aj...@alumni.iu.edu wrote: I have mentioned several posts earlier that I have done nothing about my php.ini file. From what you said, since I use U-Verse, am I supposed to do something as described here: http://helpme.att.net/pdf/uverse/uverse_hsi_qsg_english.pdf I thought with PEAR, you don't need to do that anymore. Or, am I wrong? Read the PEAR documentation: http://pear.php.net/manual/en/package.mail.mail.factory.php You can use other backends than just 'mail' - try using the smtp and fill in your smtp settings as needed. Regards Peter I saw something like that on http://email.about.com/od/emailprogrammingtips/qt/PHP_Email_SMTP_Authentication.htm, and this is probably what you are talking about? $smtp = Mail::factory('smtp', array ('host' = $host, 'auth' = true, 'username' = $username, 'password' = $password)); Do I still need to install a mail server? I have Evolution Mail on my Linux box, and looks like that is a client and not a server. Or, can I use any of the mail smtp setup, like Google? Or, do use some authentication information from http://helpme.att.net/pdf/uverse/uverse_hsi_qsg_english.pdf, since I use U-Verse at home? Yes, the example you provide is the right direction - you can put in the smtp details you use to connect from Evolution to GMail, you don't need to setup a separate smtp server on your system. Regards Peter Well, hold it. I have edited my code to hold the information as we have discussed earlier, and this is the error I have now: Warning: include_once(Net/SMTP.php) [function.include-once]: failed to open stream: No such file or directory in /usr/share/php/Mail/smtp.php on line 348 Warning: include_once() [function.include]: Failed opening 'Net/SMTP.php' for inclusion (include_path='.:/usr/share/php') in /usr/share/php/Mail/smtp.php on line 348 Fatal error: Class 'Net_SMTP' not found in /usr/share/php/Mail/smtp.php on line 349 I am not sure what this means. If I have installed pear correctly, what else do I have to do here? I can see that I have some significant error messages than not getting anything at all. Thanks for your help. 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 -- http://blogs.linux.ie/kenguest/ As the time of writing this, I have installed the missing Net_SMTP pear package unto my Linux box. I have just tested it, and I have received two email messages to the desired mailbox, without having to install a mail server. Thanks for your help. I really appreciate this. 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 Using PEAR Issues
On Tue, Apr 20, 2010 at 2:10 AM, David McGlone da...@dmcentral.net wrote: On Mon, 2010-04-19 at 08:25 -0400, Alice Wei wrote: I have not changed any of my SMTP settings since my new installation of PHP with Pear. So, I am not sure what the settings are supposed to be. Would I need to install anything else even when the Pear Mail package has been installed? You might, depending on if you need to use the Mail_Mime or Mail_Queue packages also (for sending emails with attachments etc etc or for sending mails in bulk). Also there's some rather nice new functionality in the more recent versions of Mail and Net_SMTP that enable you to log the ESMTP Id of mails you have submitted to a mail server (along with the SMTP greeting sent by that server when you connect to it). Alice, I never use the PEAR install from my distro, I always download and install PEAR into my working folder. The benefit of doing it this way is so that when you move your project to a different server, nothing will break and you don't have to change anything. Sometimes when I create a new project, I'll just copy the PEAR folder from an older project to the new one. The only thing you may have to change in your PHP code is the path to the PEAR libs only if you don't put them in the same place every time. When some bug is fixed or dependencies of some of those PEAR packages change I think you'll find your attitude towards that will change - there's a pear installer so you don't have to update and track the dependencies by hand - you do regularly update your packages don't you? It's smart to do so because at the very least you don't have to implement work-arounds for bugs that have been fixed in later versions of those packages - and in the worst-case scenario it means you're not using versions that have PEAR Security Advisories issued against them. I believe it's possible to have seperate pear config files per project so you're not limited to having to use the same versions of packages across all projects. If you're using more than a handful of PEAR packages in your project you might want to write your own meta-package for the project; that way you don't have to install all those packages individually; you just do something like $pear install myProject.xml and the pear installer will download and install whichever pear packages you have described in your xml file. Details on doing this are at http://pear.php.net/manual/en/guide.users.dependencytracking.php For the record, this is the example script that I submitted to http://www.web-development-blog.com/archives/php-mail-scripts-using-smtp-transport-a-guide-for-beginners/ for demonstrating how to use the PEAR packages for sending a mail with a file attached.: ?php require_once Mail.php; require_once Mail/mime.php; $from = Fred Flintstone fli...@example.com“; $to = “Barney Rubble barn...@example.net“; $subject = “Mail Subject”; $message = “this is the text of the mail, sent using PEAR’s Mail packages.”; $host = “smtp.example.com”; $port = “25″; $headers = array (‘From’ = $from, ‘To’ = $to, ‘Subject’ = $subject); $smtp = Mail::factory(’smtp’, array (‘host’ = $host, ‘port’ = $port)); $mime = new Mail_mime(); $mime-setTxtBody($message); $mime-addAttachment(“/home/ken/logo.png”, ‘image/png’); $body = $mime-get(); $mail = $smtp-send($to, $mime-headers($headers), $body); if (PEAR::isError($mail)) { echo($mail-getMessage() . “!\n”); } else { echo(“Message successfully sent to $to!\n”); echo “Queued As (ESMTP Id): “, $smtp-queued_as, “\n”; echo “Greeting From Mailserver: “, $smtp-greeting, “\n”; } ? Blessings, David M. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- http://blogs.linux.ie/kenguest/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mail Function Using PEAR Issues
From: peter.e.l...@gmail.com Date: Mon, 19 Apr 2010 10:15:08 +0200 Subject: Re: [PHP] Mail Function Using PEAR Issues To: aj...@alumni.iu.edu CC: php-general@lists.php.net Most, if not all, mail servers keep log files. You should look for the log files to see if the mail server has sent your mail properly or is experiencing problems (those may not feed back into PHP). 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 You know where I can find that? I use Evolution Mail, a mail server? I found it through Ubuntu yesterday. Here is the link: http://projects.gnome.org/evolution/ It asks me to put in the type of mail service I used, it grabbed Google, which is smtp.google.com. I still cannot send mail. I start to wonder what is going on. 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 Using PEAR Issues
On 20 April 2010 20:17, Alice Wei aj...@alumni.iu.edu wrote: From: peter.e.l...@gmail.com Date: Mon, 19 Apr 2010 10:15:08 +0200 Subject: Re: [PHP] Mail Function Using PEAR Issues To: aj...@alumni.iu.edu CC: php-general@lists.php.net Most, if not all, mail servers keep log files. You should look for the log files to see if the mail server has sent your mail properly or is experiencing problems (those may not feed back into PHP). 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 You know where I can find that? I use Evolution Mail, a mail server? I found it through Ubuntu yesterday. Here is the link: http://projects.gnome.org/evolution/ It asks me to put in the type of mail service I used, it grabbed Google, which is smtp.google.com. I still cannot send mail. I start to wonder what is going on. Alice Evolution is a mail client, not a mail server. Apart from that, you're using the 'mail' (PHPs mail function) as the backend mailer in your PEAR script - try using smtp instead and pass the SMTP config data you normally use. Have a look at http://pear.php.net/manual/en/package.mail.mail.factory.php - the smtp part. 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 Using PEAR Issues
On Tue, 2010-04-20 at 22:17 +0200, Peter Lind wrote: On 20 April 2010 20:17, Alice Wei aj...@alumni.iu.edu wrote: From: peter.e.l...@gmail.com Date: Mon, 19 Apr 2010 10:15:08 +0200 Subject: Re: [PHP] Mail Function Using PEAR Issues To: aj...@alumni.iu.edu CC: php-general@lists.php.net Most, if not all, mail servers keep log files. You should look for the log files to see if the mail server has sent your mail properly or is experiencing problems (those may not feed back into PHP). 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 You know where I can find that? I use Evolution Mail, a mail server? I found it through Ubuntu yesterday. Here is the link: http://projects.gnome.org/evolution/ It asks me to put in the type of mail service I used, it grabbed Google, which is smtp.google.com. I still cannot send mail. I start to wonder what is going on. Alice Evolution is a mail client, not a mail server. Apart from that, you're using the 'mail' (PHPs mail function) as the backend mailer in your PEAR script - try using smtp instead and pass the SMTP config data you normally use. Have a look at http://pear.php.net/manual/en/package.mail.mail.factory.php - the smtp part. 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 If you've got Pear on Ubuntu, can Pear not default to sendmail if no SMTP connection is set up? Thanks, Ash http://www.ashleysheridan.co.uk
RE: [PHP] Mail Function Using PEAR Issues
Subject: Re: [PHP] Mail Function Using PEAR Issues From: a...@ashleysheridan.co.uk To: peter.e.l...@gmail.com CC: aj...@alumni.iu.edu; php-general@lists.php.net Date: Tue, 20 Apr 2010 21:16:03 +0100 On Tue, 2010-04-20 at 22:17 +0200, Peter Lind wrote: On 20 April 2010 20:17, Alice Wei aj...@alumni.iu.edu wrote: From: peter.e.l...@gmail.com Date: Mon, 19 Apr 2010 10:15:08 +0200 Subject: Re: [PHP] Mail Function Using PEAR Issues To: aj...@alumni.iu.edu CC: php-general@lists.php.net Most, if not all, mail servers keep log files. You should look for the log files to see if the mail server has sent your mail properly or is experiencing problems (those may not feed back into PHP). 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 You know where I can find that? I use Evolution Mail, a mail server? I found it through Ubuntu yesterday. Here is the link: http://projects.gnome.org/evolution/ It asks me to put in the type of mail service I used, it grabbed Google, which is smtp.google.com. I still cannot send mail. I start to wonder what is going on. Alice Evolution is a mail client, not a mail server. Apart from that, you're using the 'mail' (PHPs mail function) as the backend mailer in your PEAR script - try using smtp instead and pass the SMTP config data you normally use. Have a look at http://pear.php.net/manual/en/package.mail.mail.factory.php - the smtp part. 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 If you've got Pear on Ubuntu, can Pear not default to sendmail if no SMTP connection is set up? Well, from my experience with Ubuntu, looks like that it does not do that. Unless, I am doing it wrong? Thanks, Ash http://www.ashleysheridan.co.uk _ 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 Using PEAR Issues
Subject: Re: [PHP] Mail Function Using PEAR Issues From: a...@ashleysheridan.co.uk To: peter.e.l...@gmail.com CC: aj...@alumni.iu.edu; php-general@lists.php.net Date: Tue, 20 Apr 2010 21:16:03 +0100 On Tue, 2010-04-20 at 22:17 +0200, Peter Lind wrote: On 20 April 2010 20:17, Alice Wei aj...@alumni.iu.edu wrote: From: peter.e.l...@gmail.com Date: Mon, 19 Apr 2010 10:15:08 +0200 Subject: Re: [PHP] Mail Function Using PEAR Issues To: aj...@alumni.iu.edu CC: php-general@lists.php.net Most, if not all, mail servers keep log files. You should look for the log files to see if the mail server has sent your mail properly or is experiencing problems (those may not feed back into PHP). 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 You know where I can find that? I use Evolution Mail, a mail server? I found it through Ubuntu yesterday. Here is the link: http://projects.gnome.org/evolution/ It asks me to put in the type of mail service I used, it grabbed Google, which is smtp.google.com. I still cannot send mail. I start to wonder what is going on. Alice Evolution is a mail client, not a mail server. Apart from that, you're using the 'mail' (PHPs mail function) as the backend mailer in your PEAR script - try using smtp instead and pass the SMTP config data you normally use. Have a look at http://pear.php.net/manual/en/package.mail.mail.factory.php - the smtp part. 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 If you've got Pear on Ubuntu, can Pear not default to sendmail if no SMTP connection is set up? Well, from my experience with Ubuntu, looks like that it does not do that. Unless, I am doing it wrong? Thanks, Ash http://www.ashleysheridan.co.uk _ 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 Using PEAR Issues
Most, if not all, mail servers keep log files. You should look for the log files to see if the mail server has sent your mail properly or is experiencing problems (those may not feed back into PHP). 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 Using PEAR Issues
Date: Sun, 18 Apr 2010 21:39:19 -0500 From: k...@daleco.biz To: aj...@alumni.iu.edu CC: k...@designdrumm.com; php-general@lists.php.net Subject: Re: [PHP] Mail Function Using PEAR Issues Alice Wei wrote: Date: Sun, 18 Apr 2010 21:02:29 -0500 From: k...@daleco.biz To: aj...@alumni.iu.edu CC: k...@designdrumm.com; php-general@lists.php.net Subject: Re: [PHP] Mail Function Using PEAR Issues Karl DeSaulniers wrote: Hey Alice, Again, try throwing the MIME in. $headers = 'MIME-Version: 1.0' . \r\n; $headers .= 'Content-type: text/html; charset=utf-8' . \r\n; Also: $headers .= 'Errors-to: myworkingemailaddr...@foo.com' . \r\n; Which I suggested on your previous thread. Also, I see you have $from set to equal localhost. Many SMTP servers will reject this I *think*, because localhost is a hostname, not a working mailbox. Try making $from equal to a real working address - possibly the same one as your Errors-to: header.. My $0.02, KDK On Apr 18, 2010, at 10:11 AM, Alice Wei wrote: Hi, After several days, I have rebuilt my system on Linux using Ubuntu, installed PEAR and such. Thankfully, when I execute the code, it no longer gives me the error that the class is not found. Yet, when I submit the form now, I can always see the confirmation message telling me that my message has been sent, but I cannot see it even in another mailbox. 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']; $from = localhost; $to = $email; $subject = Comments; $body = From: $your_name\n E-Mail: $email\n Reason Contact: $question\n Comments:\n $comments; $host = localhost; $headers = array ('From' = $from,'To' = $to,'Subject' = $subject); $mail -send($to, $headers, $body); if (PEAR::isError($mail)) echo p . $mail-getMessage() . /p; else { echo pMessage successfully sent!/p div id='main' h1Thank You For Contacting Us/h1 pWe will contact you within the next b24 business hours/b./p pHere is what you have input:/p ulliYour Name is b . $your_name . /b/li liYour Email is b . $email . /b/li liYou contacted us because you have a b . $question . /b/li liHere are your comments: b . $comments . /b/li/ul h1Have a Nice Day!/h1/div; } } Can anyone on the list please give me some pointers on what might have been wrong here? I have not edited anything in the php.ini file regarding SMTP. Thanks. Alice Hi, Here is the revised version, and I don't think I have experienced any changes in terms of the output on the screen. Plus, I still get no email. ?php 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']; $from = aj...@alumni.iu.edu; $to = elite.engl...@gmail.com; $subject = Comments; $body = From: $your_name\n E-Mail: $email\n Reason Contact: $question\n Comments:\n $comments; $headers = 'MIME-Version: 1.0' . \r\n; $headers .= 'Content-type: text/html; charset=utf-8' . \r\n; $headers .= 'Errors-to: elite.engl...@gmail.com' . \r\n; $mail -send($to, $headers, $body); if (PEAR::isError($mail)) echo p . $mail-getMessage() . /p; else { echo pMessage successfully sent!/p div id='main' h1Thank You For Contacting Us/h1 pHere is what you have input:/p ulliYour Name is b . $your_name . /b/li liYour Email is b . $email . /b/li liYou contacted us because you have a b . $question . /b/li liHere are your comments: b . $comments . /b/li/ul h1Have a Nice Day!/h1/div; } I have made sure that my $from and $to addresses are different, Could there be anything else wrong here? I have not edited anything in php.ini regarding this issue. Would I need to? Well, it's a Good Thing(tm) to know what those settings are. Have they changed since your last thread? I have not changed any of my SMTP settings since my new installation of PHP with Pear. So, I am not sure what the settings are supposed to be. Would I need to install anything else even when the Pear Mail package has been installed? 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 Using PEAR Issues
On Mon, 2010-04-19 at 08:25 -0400, Alice Wei wrote: I have not changed any of my SMTP settings since my new installation of PHP with Pear. So, I am not sure what the settings are supposed to be. Would I need to install anything else even when the Pear Mail package has been installed? Alice, I never use the PEAR install from my distro, I always download and install PEAR into my working folder. The benefit of doing it this way is so that when you move your project to a different server, nothing will break and you don't have to change anything. Sometimes when I create a new project, I'll just copy the PEAR folder from an older project to the new one. The only thing you may have to change in your PHP code is the path to the PEAR libs only if you don't put them in the same place every time. Blessings, David M. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Mail Function Using PEAR Issues
Hi, After several days, I have rebuilt my system on Linux using Ubuntu, installed PEAR and such. Thankfully, when I execute the code, it no longer gives me the error that the class is not found. Yet, when I submit the form now, I can always see the confirmation message telling me that my message has been sent, but I cannot see it even in another mailbox. 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']; $from = localhost; $to = $email; $subject = Comments; $body = From: $your_name\n E-Mail: $email\n Reason Contact: $question\n Comments:\n $comments; $host = localhost; $headers = array ('From' = $from,'To' = $to,'Subject' = $subject); $mail -send($to, $headers, $body); if (PEAR::isError($mail)) echo p . $mail-getMessage() . /p; else { echo pMessage successfully sent!/p div id='main' h1Thank You For Contacting Us/h1 pWe will contact you within the next b24 business hours/b./p pHere is what you have input:/p ulliYour Name is b . $your_name . /b/li liYour Email is b . $email . /b/li liYou contacted us because you have a b . $question . /b/li liHere are your comments: b . $comments . /b/li/ul h1Have a Nice Day!/h1/div; } } Can anyone on the list please give me some pointers on what might have been wrong here? I have not edited anything in the php.ini file regarding SMTP. Thanks. Alice _ 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 Using PEAR Issues
Hey Alice, Again, try throwing the MIME in. $headers = 'MIME-Version: 1.0' . \r\n; $headers .= 'Content-type: text/html; charset=utf-8' . \r\n; Karl On Apr 18, 2010, at 10:11 AM, Alice Wei wrote: Hi, After several days, I have rebuilt my system on Linux using Ubuntu, installed PEAR and such. Thankfully, when I execute the code, it no longer gives me the error that the class is not found. Yet, when I submit the form now, I can always see the confirmation message telling me that my message has been sent, but I cannot see it even in another mailbox. 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']; $from = localhost; $to = $email; $subject = Comments; $body = From: $your_name\n E-Mail: $email\n Reason Contact: $question\n Comments:\n $comments; $host = localhost; $headers = array ('From' = $from,'To' = $to,'Subject' = $subject); $mail -send($to, $headers, $body); if (PEAR::isError($mail)) echo p . $mail-getMessage() . /p; else { echo pMessage successfully sent!/p div id='main' h1Thank You For Contacting Us/h1 pWe will contact you within the next b24 business hours/ b./p pHere is what you have input:/p ulliYour Name is b . $your_name . /b/li liYour Email is b . $email . /b/li liYou contacted us because you have a b . $question . /b/li liHere are your comments: b . $comments . /b/ li/ul h1Have a Nice Day!/h1/div; } } Can anyone on the list please give me some pointers on what might have been wrong here? I have not edited anything in the php.ini file regarding SMTP. Thanks. Alice _ 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 Using PEAR Issues
Karl DeSaulniers wrote: Hey Alice, Again, try throwing the MIME in. $headers = 'MIME-Version: 1.0' . \r\n; $headers .= 'Content-type: text/html; charset=utf-8' . \r\n; Also: $headers .= 'Errors-to: myworkingemailaddr...@foo.com' . \r\n; Which I suggested on your previous thread. Also, I see you have $from set to equal localhost. Many SMTP servers will reject this I *think*, because localhost is a hostname, not a working mailbox. Try making $from equal to a real working address - possibly the same one as your Errors-to: header.. My $0.02, KDK On Apr 18, 2010, at 10:11 AM, Alice Wei wrote: Hi, After several days, I have rebuilt my system on Linux using Ubuntu, installed PEAR and such. Thankfully, when I execute the code, it no longer gives me the error that the class is not found. Yet, when I submit the form now, I can always see the confirmation message telling me that my message has been sent, but I cannot see it even in another mailbox. 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']; $from = localhost; $to = $email; $subject = Comments; $body = From: $your_name\n E-Mail: $email\n Reason Contact: $question\n Comments:\n $comments; $host = localhost; $headers = array ('From' = $from,'To' = $to,'Subject' = $subject); $mail -send($to, $headers, $body); if (PEAR::isError($mail)) echo p . $mail-getMessage() . /p; else { echo pMessage successfully sent!/p div id='main' h1Thank You For Contacting Us/h1 pWe will contact you within the next b24 business hours/b./p pHere is what you have input:/p ulliYour Name is b . $your_name . /b/li liYour Email is b . $email . /b/li liYou contacted us because you have a b . $question . /b/li liHere are your comments: b . $comments . /b/li/ul h1Have a Nice Day!/h1/div; } } Can anyone on the list please give me some pointers on what might have been wrong here? I have not edited anything in the php.ini file regarding SMTP. Thanks. Alice -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mail Function Using PEAR Issues
Date: Sun, 18 Apr 2010 21:02:29 -0500 From: k...@daleco.biz To: aj...@alumni.iu.edu CC: k...@designdrumm.com; php-general@lists.php.net Subject: Re: [PHP] Mail Function Using PEAR Issues Karl DeSaulniers wrote: Hey Alice, Again, try throwing the MIME in. $headers = 'MIME-Version: 1.0' . \r\n; $headers .= 'Content-type: text/html; charset=utf-8' . \r\n; Also: $headers .= 'Errors-to: myworkingemailaddr...@foo.com' . \r\n; Which I suggested on your previous thread. Also, I see you have $from set to equal localhost. Many SMTP servers will reject this I *think*, because localhost is a hostname, not a working mailbox. Try making $from equal to a real working address - possibly the same one as your Errors-to: header.. My $0.02, KDK On Apr 18, 2010, at 10:11 AM, Alice Wei wrote: Hi, After several days, I have rebuilt my system on Linux using Ubuntu, installed PEAR and such. Thankfully, when I execute the code, it no longer gives me the error that the class is not found. Yet, when I submit the form now, I can always see the confirmation message telling me that my message has been sent, but I cannot see it even in another mailbox. 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']; $from = localhost; $to = $email; $subject = Comments; $body = From: $your_name\n E-Mail: $email\n Reason Contact: $question\n Comments:\n $comments; $host = localhost; $headers = array ('From' = $from,'To' = $to,'Subject' = $subject); $mail -send($to, $headers, $body); if (PEAR::isError($mail)) echo p . $mail-getMessage() . /p; else { echo pMessage successfully sent!/p div id='main' h1Thank You For Contacting Us/h1 pWe will contact you within the next b24 business hours/b./p pHere is what you have input:/p ulliYour Name is b . $your_name . /b/li liYour Email is b . $email . /b/li liYou contacted us because you have a b . $question . /b/li liHere are your comments: b . $comments . /b/li/ul h1Have a Nice Day!/h1/div; } } Can anyone on the list please give me some pointers on what might have been wrong here? I have not edited anything in the php.ini file regarding SMTP. Thanks. Alice Hi, Here is the revised version, and I don't think I have experienced any changes in terms of the output on the screen. Plus, I still get no email. ?php 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']; $from = aj...@alumni.iu.edu; $to = elite.engl...@gmail.com; $subject = Comments; $body = From: $your_name\n E-Mail: $email\n Reason Contact: $question\n Comments:\n $comments; $headers = 'MIME-Version: 1.0' . \r\n; $headers .= 'Content-type: text/html; charset=utf-8' . \r\n; $headers .= 'Errors-to: elite.engl...@gmail.com' . \r\n; $mail -send($to, $headers, $body); if (PEAR::isError($mail)) echo p . $mail-getMessage() . /p; else { echo pMessage successfully sent!/p div id='main' h1Thank You For Contacting Us/h1 pHere is what you have input:/p ulliYour Name is b . $your_name . /b/li liYour Email is b . $email . /b/li liYou contacted us because you have a b . $question . /b/li liHere are your comments: b . $comments . /b/li/ul h1Have a Nice Day!/h1/div; } I have made sure that my $from and $to addresses are different, Could there be anything else wrong here? I have not edited anything in php.ini regarding this issue. Would I need to? 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 Using PEAR Issues
Is there any need for this line if you are using the Errors-to: ? Maybe take it out and see what Errors-to gives you without it. On Apr 18, 2010, at 9:27 PM, Alice Wei wrote: if (PEAR::isError($mail)) echo p . $mail-getMessage() . OAN - That sendmail script I posted, I know works on Linux servers if you want to compare notes with it. Best, 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 Using PEAR Issues
Alice Wei wrote: Date: Sun, 18 Apr 2010 21:02:29 -0500 From: k...@daleco.biz To: aj...@alumni.iu.edu CC: k...@designdrumm.com; php-general@lists.php.net Subject: Re: [PHP] Mail Function Using PEAR Issues Karl DeSaulniers wrote: Hey Alice, Again, try throwing the MIME in. $headers = 'MIME-Version: 1.0' . \r\n; $headers .= 'Content-type: text/html; charset=utf-8' . \r\n; Also: $headers .= 'Errors-to: myworkingemailaddr...@foo.com' . \r\n; Which I suggested on your previous thread. Also, I see you have $from set to equal localhost. Many SMTP servers will reject this I *think*, because localhost is a hostname, not a working mailbox. Try making $from equal to a real working address - possibly the same one as your Errors-to: header.. My $0.02, KDK On Apr 18, 2010, at 10:11 AM, Alice Wei wrote: Hi, After several days, I have rebuilt my system on Linux using Ubuntu, installed PEAR and such. Thankfully, when I execute the code, it no longer gives me the error that the class is not found. Yet, when I submit the form now, I can always see the confirmation message telling me that my message has been sent, but I cannot see it even in another mailbox. 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']; $from = localhost; $to = $email; $subject = Comments; $body = From: $your_name\n E-Mail: $email\n Reason Contact: $question\n Comments:\n $comments; $host = localhost; $headers = array ('From' = $from,'To' = $to,'Subject' = $subject); $mail -send($to, $headers, $body); if (PEAR::isError($mail)) echo p . $mail-getMessage() . /p; else { echo pMessage successfully sent!/p div id='main' h1Thank You For Contacting Us/h1 pWe will contact you within the next b24 business hours/b./p pHere is what you have input:/p ulliYour Name is b . $your_name . /b/li liYour Email is b . $email . /b/li liYou contacted us because you have a b . $question . /b/li liHere are your comments: b . $comments . /b/li/ul h1Have a Nice Day!/h1/div; } } Can anyone on the list please give me some pointers on what might have been wrong here? I have not edited anything in the php.ini file regarding SMTP. Thanks. Alice Hi, Here is the revised version, and I don't think I have experienced any changes in terms of the output on the screen. Plus, I still get no email. ?php 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']; $from = aj...@alumni.iu.edu; $to = elite.engl...@gmail.com; $subject = Comments; $body = From: $your_name\n E-Mail: $email\n Reason Contact: $question\n Comments:\n $comments; $headers = 'MIME-Version: 1.0' . \r\n; $headers .= 'Content-type: text/html; charset=utf-8' . \r\n; $headers .= 'Errors-to: elite.engl...@gmail.com' . \r\n; $mail -send($to, $headers, $body); if (PEAR::isError($mail)) echo p . $mail-getMessage() . /p; else { echo pMessage successfully sent!/p div id='main' h1Thank You For Contacting Us/h1 pHere is what you have input:/p ulliYour Name is b . $your_name . /b/li liYour Email is b . $email . /b/li liYou contacted us because you have a b . $question . /b/li liHere are your comments: b . $comments . /b/li/ul h1Have a Nice Day!/h1/div; } I have made sure that my $from and $to addresses are different, Could there be anything else wrong here? I have not edited anything in php.ini regarding this issue. Would I need to? Well, it's a Good Thing(tm) to know what those settings are. Have they changed since your last thread? KDK -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
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
[PHP] Mail Function Problem
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
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
[PHP] About the php mail function and imap_mail function
Hi, everyone! I have a problem about the php mail function and imap_mail function. When I use the mail or imap_mail function to send a email, the php script sends the email through the local mail sever with sendmail or another MTA supported. However, I have a gmail account. I just want the php script to send emails via my gmail account. How can I do it? Thank you.
Re: [PHP] About the php mail function and imap_mail function
Am 04.04.2010 14:28, schrieb ttplayer: Hi, everyone! I have a problem about the php mail function and imap_mail function. When I use the mail or imap_mail function to send a email, the php script sends the email through the local mail sever with sendmail or another MTA supported. However, I have a gmail account. I just want the php script to send emails via my gmail account. How can I do it? Thank you. a) use an external SMTP-class, you could take a look at PEAR (which directly etablishes a connection to your gmail-account) b) configure your mail-server/system that he delivers the mails via an external SMTP_Server - there are several tutorials how to do that in the inet Regards, Valentin Dreismann -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] About the php mail function and imap_mail function
Hello ttplayer, If GMail does allow sending through socket, wait a bit, I'll upload a class written on my own for sending mail through a custom SMTP via socket. -- With best regards from Ukraine, Andre Skype: Francophile; WlmMSN: arthaelon @ yandex.ru; Jabber: arthaelon @ jabber.org Yahoo! messenger: andre.polykanine; ICQ: 191749952 Twitter: m_elensule - Original message - From: ttplayer f...@qq.com To: php-general php-general@lists.php.net Date: Sunday, April 4, 2010, 3:28:33 PM Subject: [PHP] About the php mail function and imap_mail function Hi, everyone! I have a problem about the php mail function and imap_mail function. When I use the mail or imap_mail function to send a email, the php script sends the email through the local mail sever with sendmail or another MTA supported. However, I have a gmail account. I just want the php script to send emails via my gmail account. How can I do it? Thank you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail Function In PHP
Having worked at a decent sized, respectable ISP with 100,000+ customers sending email via Iron Ports (email scanners), even they would get put on a blacklist on a monthly basis. Hell it wouldn't surprise me if Gmail's SMTP servers got put on a black list at some point. There's seemingly hundreds of blacklists and whilst some play nice, others are very paranoid. Usually the good email servers will detect your on a blacklist then rate limit the number of emails it'll accept from you. If you keep pissing it off, by sending emails to non-existant addresses (something they REALLY hate), sending emails that are too big, or simply sending too many emails or emails with too many recipients, then it'll tighten the restrictions. Over time if your good then those restrictions will be released and eventually you'll be able to send at normal rates. -- Michael Kubler I believe in a better world. I support the Zeitgeist Movement -- www.zeitgeistaustralia.org Teus Benschop wrote: Once a domain or ip address was black listed, it was quite a process to get it unlisted again, and even then as soon as mail came from that domain, it got blacklisted again. Supposedly there is some certification process that official smtp relays need to go through so as to prove or certify that they won't allow spam to be sent through them, and take steps to remove offenders from using their relay. However, this is all guessing, and in the end we just gave up and used our ISP's official relay. Teus. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail Function In PHP
On 7 March 2010 04:54, Kannan kanna...@gmail.com wrote: Hello I am creating a application for our college using the php.In that i want to send mail to all who are all the list. For that i am just simply use the mail function in php without configuring any mail system in the system.But the mail didn't send. For sending the mails wat are requirements and if u have any tutorials send it to me? Thanks.. -- With regards, Kannan. R. P, Blog @: http://kannan4k.wordpress.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Contrary to popular belief, to send an email you do not need to have your own SMTP server. All you need to know is the SMTP server responsible for your recipients email. This information is held as part of the domain registration details and is known as the MX records (as I understand it). PHP has a function called getmxrr() [1]. This allows you to supply a domain name and get back the list of MX records suitable for handling the SMTP mail. This function wasn't available on Windows until recently, and I created a userland version utilising Windows nslookup.exe program [2]. So, once you've got the list of SMTP servers for the domain you are sending email to, you can use the ini_set('SMTP', 'xx'); function to set the server to handle the mail() call you are about to make. Upside : No local SMTP server - you are not responsible for maintaining/administering/etc. any aspect of the SMTP process. Upside : If the mail() call fails, you can try the other MX records (I tend to sort the results based upon weight and try them in sequence). If it fails all of them, you know straight away and can deal with it. Upside : No relaying. No permission issues to worry about. You are simply talking to the public SMTP servers just like any other SMTP server or sender. Downside : No queuing. Without a _LOCAL_ SMTP server, you can only deal with sending email in real time. Downside : One domain at a time. You cannot send email to a...@domain1.com, b...@domain2.com _AND_ c...@domain3.com in the 1 email. None of these steps affect the use of mail() or a mail sending class (phpmailer, RMail, html_mime_mail5, etc.). Regards, Richard. [1] http://docs.php.net/getmxrr [2] http://docs.php.net/getmxrr#53182 Richard. -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail Function In PHP
On Mon, 2010-03-08 at 10:21 +, Richard Quadling wrote: Contrary to popular belief, to send an email you do not need to have your own SMTP server. All you need to know is the SMTP server responsible for your recipients email. [...] While the above is true, there is also another thing that comes into play. We used to send email directly to the receiver the way described above. But at times it happens that the receiving smtp server refuses to accept mail from the sender since the sender is not known to be a good smtp server, and at times it could get blacklisted. Rules like this get tightened up because of the desire to curb spam at the source. Teus. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail Function In PHP
On 8 March 2010 13:06, Teus Benschop teusjanne...@gmail.com wrote: On Mon, 2010-03-08 at 10:21 +, Richard Quadling wrote: Contrary to popular belief, to send an email you do not need to have your own SMTP server. All you need to know is the SMTP server responsible for your recipients email. [...] While the above is true, there is also another thing that comes into play. We used to send email directly to the receiver the way described above. But at times it happens that the receiving smtp server refuses to accept mail from the sender since the sender is not known to be a good smtp server, and at times it could get blacklisted. Rules like this get tightened up because of the desire to curb spam at the source. Teus. Black listing can happen even for valid domains. -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail Function In PHP
On 8 March 2010 13:06, Teus Benschop teusjanne...@gmail.com wrote: On Mon, 2010-03-08 at 10:21 +, Richard Quadling wrote: Contrary to popular belief, to send an email you do not need to have your own SMTP server. All you need to know is the SMTP server responsible for your recipients email. [...] While the above is true, there is also another thing that comes into play. We used to send email directly to the receiver the way described above. But at times it happens that the receiving smtp server refuses to accept mail from the sender since the sender is not known to be a good smtp server, and at times it could get blacklisted. Rules like this get tightened up because of the desire to curb spam at the source. Teus. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php So, say I did go and setup a local SMTP relay, how would I make it known that it was a real smtp server and not just some script pushing spam? -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail Function In PHP
On Mon, 2010-03-08 at 17:18 +, Richard Quadling wrote: On 8 March 2010 13:06, Teus Benschop teusjanne...@gmail.com wrote: On Mon, 2010-03-08 at 10:21 +, Richard Quadling wrote: Contrary to popular belief, to send an email you do not need to have your own SMTP server. All you need to know is the SMTP server responsible for your recipients email. [...] While the above is true, there is also another thing that comes into play. We used to send email directly to the receiver the way described above. But at times it happens that the receiving smtp server refuses to accept mail from the sender since the sender is not known to be a good smtp server, and at times it could get blacklisted. Rules like this get tightened up because of the desire to curb spam at the source. Teus. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php So, say I did go and setup a local SMTP relay, how would I make it known that it was a real smtp server and not just some script pushing spam? -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling By having your local relay talk seductively to the remote server? More sensibly though, I would assume that you could use some sort of certificate for this, although I don't know much about mail servers. Thanks, Ash http://www.ashleysheridan.co.uk
Re: [PHP] Mail Function In PHP
If you control your DNS server setup and such, DKIM and authentication technologies alikes (http://en.wikipedia.org/wiki/DomainKeys) are the way to go. Also, make sure the reverse DNS lookup is pointing to the right place, i.e. that the SMTP server domain name translates to an IP that translates back to the same domain name when you do a reverse lookup. Since this is really something more of a network arch. setup, you probably will find more answers for that on ServerFault or the likes. MT On Tue, Mar 9, 2010 at 2:18 AM, Ashley Sheridan a...@ashleysheridan.co.ukwrote: On Mon, 2010-03-08 at 17:18 +, Richard Quadling wrote: On 8 March 2010 13:06, Teus Benschop teusjanne...@gmail.com wrote: On Mon, 2010-03-08 at 10:21 +, Richard Quadling wrote: Contrary to popular belief, to send an email you do not need to have your own SMTP server. All you need to know is the SMTP server responsible for your recipients email. [...] While the above is true, there is also another thing that comes into play. We used to send email directly to the receiver the way described above. But at times it happens that the receiving smtp server refuses to accept mail from the sender since the sender is not known to be a good smtp server, and at times it could get blacklisted. Rules like this get tightened up because of the desire to curb spam at the source. Teus. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php So, say I did go and setup a local SMTP relay, how would I make it known that it was a real smtp server and not just some script pushing spam? -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling By having your local relay talk seductively to the remote server? More sensibly though, I would assume that you could use some sort of certificate for this, although I don't know much about mail servers. Thanks, Ash http://www.ashleysheridan.co.uk -- Marc Trudel-Bélisle www.wizcorp.jp
Re: [PHP] Mail Function In PHP
On Mon, 2010-03-08 at 17:18 +, Richard Quadling wrote: So, say I did go and setup a local SMTP relay, how would I make it known that it was a real smtp server and not just some script pushing spam? Once a domain or ip address was black listed, it was quite a process to get it unlisted again, and even then as soon as mail came from that domain, it got blacklisted again. Supposedly there is some certification process that official smtp relays need to go through so as to prove or certify that they won't allow spam to be sent through them, and take steps to remove offenders from using their relay. However, this is all guessing, and in the end we just gave up and used our ISP's official relay. Teus. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail Function In PHP
On 03/08/2010 06:18 PM, Richard Quadling wrote: On 8 March 2010 13:06, Teus Benschopteusjanne...@gmail.com wrote: On Mon, 2010-03-08 at 10:21 +, Richard Quadling wrote: Contrary to popular belief, to send an email you do not need to have your own SMTP server. All you need to know is the SMTP server responsible for your recipients email. [...] above. But at times it happens that the receiving smtp server refuses to accept mail from the sender since the sender is not known to be a good smtp server, and at times it could get blacklisted. Rules like this get tightened up because of the desire to curb spam at the source. Teus. So, say I did go and setup a local SMTP relay, how would I make it known that it was a real smtp server and not just some script pushing spam? You can use SPF, DomainKeys plus valid DNS information. I have setup SPF records for my domains. If you attempt to send E-Mail as if it was sent from my server then any server doing SPF record checking will not accept or simply drop your message. I have not setup DomainKeys since SPF has served me well but I will configure it soon. -- John Insanity in individuals is something rare - but in groups, parties, nations and epochs, it is the rule. [Friedrich Nietzsche] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail Function In PHP
On 03/08/2010 10:45 PM, John Black wrote: You can use SPF, DomainKeys plus valid DNS information. I have setup SPF records for my domains. If you attempt to send E-Mail as if it was sent from my server then any server doing SPF record checking will not accept or simply drop your message. I have not setup DomainKeys since SPF has served me well but I will configure it soon. woops, forgot to add that I doubt that you'll be able to get a pure webserver to do this for you, reliably, since some smtp servers will call your server back and check if the e-mail account exists. I'd assume that the server will drop the mail if your script sending server is not even running smtp on port 25. -- John Niemand ist frei, der über sich selbst nicht Herr ist. [Matthias Claudius] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail Function In PHP
Any volume of mail sent direct to mx records is a red flag for anti spammers and without an smtp spf dkim and rdns you are wasting your time. The logic is that only people sending spam would be sending direct to mx like that. Fair or not that is just how life works. Oh and most mail servers do check rdns spf etc. It is kind of pointless to send emails if they end up in the spam folder or worse don't get delivered at all. Do it right the first time use an smtp rdns and spf at the very least. Sent via BlackBerry from T-Mobile -Original Message- From: Richard Quadling rquadl...@googlemail.com Date: Mon, 8 Mar 2010 10:21:53 To: Kannankanna...@gmail.com Cc: php-general@lists.php.net Subject: Re: [PHP] Mail Function In PHP On 7 March 2010 04:54, Kannan kanna...@gmail.com wrote: Hello I am creating a application for our college using the php.In that i want to send mail to all who are all the list. For that i am just simply use the mail function in php without configuring any mail system in the system.But the mail didn't send. For sending the mails wat are requirements and if u have any tutorials send it to me? Thanks.. -- With regards, Kannan. R. P, Blog @: http://kannan4k.wordpress.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Contrary to popular belief, to send an email you do not need to have your own SMTP server. All you need to know is the SMTP server responsible for your recipients email. This information is held as part of the domain registration details and is known as the MX records (as I understand it). PHP has a function called getmxrr() [1]. This allows you to supply a domain name and get back the list of MX records suitable for handling the SMTP mail. This function wasn't available on Windows until recently, and I created a userland version utilising Windows nslookup.exe program [2]. So, once you've got the list of SMTP servers for the domain you are sending email to, you can use the ini_set('SMTP', 'xx'); function to set the server to handle the mail() call you are about to make. Upside : No local SMTP server - you are not responsible for maintaining/administering/etc. any aspect of the SMTP process. Upside : If the mail() call fails, you can try the other MX records (I tend to sort the results based upon weight and try them in sequence). If it fails all of them, you know straight away and can deal with it. Upside : No relaying. No permission issues to worry about. You are simply talking to the public SMTP servers just like any other SMTP server or sender. Downside : No queuing. Without a_LOCAL_ SMTP server, you can only deal with sending email in real time. Downside : One domain at a time. You cannot send email to a...@domain1.com, b...@domain2.com_and_ c...@domain3.com in the 1 email. None of these steps affect the use of mail() or a mail sending class (phpmailer, RMail, html_mime_mail5, etc.). Regards, Richard. [1] http://docs.php.net/getmxrr [2] http://docs.php.net/getmxrr#53182 Richard. -- - Richard Quadling Standing on the shoulders of some very clever giants! EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731 ZOPA : http://uk.zopa.com/member/RQuadling -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Mail Function In PHP
Hello I am creating a application for our college using the php.In that i want to send mail to all who are all the list. For that i am just simply use the mail function in php without configuring any mail system in the system.But the mail didn't send. For sending the mails wat are requirements and if u have any tutorials send it to me? Thanks.. -- With regards, Kannan. R. P, Blog @: http://kannan4k.wordpress.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail Function In PHP
You need SMTP Server for this.. Read bellow link to know more how to configure SMTP Server in PHP http://email.about.com/od/emailprogrammingtips/qt/Configure_PHP_to_Use_a_Remote_SMTP_Server_for_Sending_Mail.htm http://email.about.com/od/emailprogrammingtips/qt/Configure_PHP_to_Use_a_Remote_SMTP_Server_for_Sending_Mail.htm On Sun, Mar 7, 2010 at 10:24 AM, Kannan kanna...@gmail.com wrote: Hello I am creating a application for our college using the php.In that i want to send mail to all who are all the list. For that i am just simply use the mail function in php without configuring any mail system in the system.But the mail didn't send. For sending the mails wat are requirements and if u have any tutorials send it to me? Thanks.. -- With regards, Kannan. R. P, Blog @: http://kannan4k.wordpress.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Devendra Jadhav देवेंद्र जाधव
Re: [PHP] Mail Function In PHP
Kannan wrote: Hello I am creating a application for our college using the php.In that i want to send mail to all who are all the list. For that i am just simply use the mail function in php without configuring any mail system in the system.But the mail didn't send. For sending the mails wat are requirements and if u have any tutorials send it to me? Thanks.. Hello, Read the manual page for the mail() function ... http://www.php.net/mail Mail() requires an operating SMTP server. This can be set in php.ini, and possibly via the ini_set() function. These might be worth looking into: $config1=ini_set(sendmail_path,/usr/sbin/sendmail -t -i); $config2=ini_set(SMTP,localhost); $config3=ini_set(smtp_port,25); If you absolutely can't run an SMTP server or use a remote server, you'd probably have to hack something together with sockets or streams. My $0.02, Kevin Kinsey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php mail() function and ezmlm
I'm having trouble sending info from a form to the list-subscr...@domain Does anyone know why ezmlm doesn't recognize the mail() function?
Re: [PHP] php mail() function and ezmlm
Can you send it to other email addresses? -- Vikash Kumar http://vika.sh On Thu, Jan 14, 2010 at 12:16 PM, Bob Strasser bstras...@noccorp.comwrote: I'm having trouble sending info from a form to the list-subscr...@domain Does anyone know why ezmlm doesn't recognize the mail() function?
Re: [PHP] php mail() function
After a long delay, I've finally got mail working. I had decided to move on in the book that I'm working through (Head First PHP MySQL) but doubled back to address the mail issue again. This is how I finally got it to work: 1. Switched to XAMPP for linux rather than using my existing versions of mysql, php and apache. 2. Uninstalled Postfix and reinstalled Sendmail. Then I followed the instructions here: http://dbaron.org/linux/sendmail I can't vouch that the method described at that link is completely safe and secure, but it worked for me and was very easy. I've spent many hours and days trying to get this to work so am very relieved. My only complaint is that there is quite a long delay after submitting report.html (from Ch. 1) while it says 'waiting for localhost...'. It can take up to 20 seconds or so before sending and giving confirmation. Thanks for all your help. On Mon, Oct 26, 2009 at 4:37 AM, Bob McConnell r...@cbord.com wrote: From: James Prentice I have tried setting both $to and $email to be the same shaw address since I assumed it should be recognized by the mail server, but it's still getting bounced. So why is 'www-d...@homemade' being listed as the sender? Any ideas? I strongly recommend you call the help desk at Shaw and ask them to explain what is happening. They should know what is going on with their servers. Everyone on this list appears to be guessing at the problem, which is not likely to help you. Bob McConnell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php mail() function
It looks like using XAMPP wasn't strictly necessary. I tried running this example again using my previous versions of mysql and apache and it worked fine. So the key is to configure Sendmail as described at the URL I gave. On Wed, Nov 25, 2009 at 10:58 AM, James Prentice prentice@gmail.com wrote: After a long delay, I've finally got mail working. I had decided to move on in the book that I'm working through (Head First PHP MySQL) but doubled back to address the mail issue again. This is how I finally got it to work: 1. Switched to XAMPP for linux rather than using my existing versions of mysql, php and apache. 2. Uninstalled Postfix and reinstalled Sendmail. Then I followed the instructions here: http://dbaron.org/linux/sendmail I can't vouch that the method described at that link is completely safe and secure, but it worked for me and was very easy. I've spent many hours and days trying to get this to work so am very relieved. My only complaint is that there is quite a long delay after submitting report.html (from Ch. 1) while it says 'waiting for localhost...'. It can take up to 20 seconds or so before sending and giving confirmation. Thanks for all your help. On Mon, Oct 26, 2009 at 4:37 AM, Bob McConnell r...@cbord.com wrote: From: James Prentice I have tried setting both $to and $email to be the same shaw address since I assumed it should be recognized by the mail server, but it's still getting bounced. So why is 'www-d...@homemade' being listed as the sender? Any ideas? I strongly recommend you call the help desk at Shaw and ask them to explain what is happening. They should know what is going on with their servers. Everyone on this list appears to be guessing at the problem, which is not likely to help you. Bob McConnell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php mail() function
From: James Prentice I have tried setting both $to and $email to be the same shaw address since I assumed it should be recognized by the mail server, but it's still getting bounced. So why is 'www-d...@homemade' being listed as the sender? Any ideas? I strongly recommend you call the help desk at Shaw and ask them to explain what is happening. They should know what is going on with their servers. Everyone on this list appears to be guessing at the problem, which is not likely to help you. Bob McConnell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php mail() function
Bob McConnell wrote: I strongly recommend you call the help desk at Shaw and ask them to explain what is happening. They should know what is going on with their servers. Everyone on this list appears to be guessing at the problem, which is not likely to help you. But they are educated guesses :) No seriously, without a definitive error message it is hard to say for sure. Since he only needs postfix on the server to allow php to email out I may have a different solution for him. I sent him my custom smtp_email function which talks to the ISPs SMTP server directly and supports authentication. Lets see if that help. -- John Nur wer im Wohlstand lebt, schimpft auf ihn. [Ludwig Marcuse] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php mail() function
Paul M Foster wrote: 4. All due respect to Kranthi, but I believe he's wrong about relaying mail from your webserver to the ISP's mailserver. I believe the ISP's mailserver doesn't care, as long as the mail comes from your pipe. You could probably call yourself pi...@pepperoni.com and your ISP would accept it. It's just the From:. Again, I could be wrong. All the ISPs I have used so far require the user to authenticate even when on the same network. So if you want to relay through the SMTP server of your ISP you need to login first. I think that is what Kranthi said Try this: 1) Set up a password maps file (/etc/postfix/sasl_passwd) with the content: mail.ispserver.comusername:password Now Execute these commands # chown root:root /etc/postfix/sasl_passwd # chmod 600 /etc/postfix/sasl_passwd # postmap /etc/postfix/sasl_passwd And change your config to this /etc/postfix/main.cf: relayhost = mail.ispserver.com smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_sasl_security_options = noanonymous Now reload postfix and try it again. # postfix reload -- John Question / Answer based CAPTCHA http://www.network-technologies.org/tiny.php?id=1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php mail() function
Thanks, John. I set up the sasl_passwd file as per your instructions but am still getting status=bounced. I'm wondering, what should the values in main.cf be for 'myhostname' and 'mydestination'? These pages give some info on the Shaw mail servers, but I'm not certain which I should be using: http://www.shaw.ca/en-ca/CustomerCare/InternetSupport/Residential/Email/ServiceDetails.htm http://www.shaw.ca/en-ca/CustomerCare/InternetSupport/Residential/RoutersandShawServerNames.htm Also, I notice that in the mail.log file, the 'from:' value is 'www-d...@homemade'. The actual 'from:' value is provided to the php mail() function via a web form, so should be somebody's email address (e.g. my own in this case). from=www-d...@homemade, size=523, nrcpt=1 (queue active) Oct 24 12:49:40 homemade postfix/error[7530]: B80B7A70109: to=x...@gmail.com, relay=none, delay=0.04, delays=0.03/0/0/0.01, dsn=5.0.0, status=bounced (shawmail) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php mail() function
James Prentice wrote: Also, I notice that in the mail.log file, the 'from:' value is 'www-d...@homemade'. The actual 'from:' value is provided to the php mail() function via a web form, so should be somebody's email address (e.g. my own in this case). I think PHP will use the apache user and domain to generate the email address. I use my own smtp function so I can't say for certain. One thing you could try is to use a valid email account on the server for the FROM address so that you can receive the bounced message. The actual message should contain more information. Alternatively attempt to increase the loglevel of postfix so you get exact feedback of why the connection is failing. As far as which server to use. I think this page lists the correct one: http://www.shaw.ca/en-ca/CustomerCare/InternetSupport/Residential/RoutersandShawServerNames.htm -- John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php mail() function
It sends the bounced message to /var/mail/www-data and I get this: --19BE8A70109.1256417846/homemade Content-Description: Delivery report Content-Type: message/delivery-status Reporting-MTA: dns; homemade X-Postfix-Queue-ID: 19BE8A70109 X-Postfix-Sender: rfc822; www-d...@homemade Arrival-Date: Sat, 24 Oct 2009 13:57:26 -0700 (PDT) Final-Recipient: rfc822; x...@shaw.ca Action: failed Status: 5.0.0 Diagnostic-Code: X-Postfix; shawmail.vc.shawcable.net --19BE8A70109.1256417846/homemade Content-Description: Undelivered Message Content-Type: message/rfc822 Received: by homemade (Postfix, from userid 33) id 19BE8A70109; Sat, 24 Oct 2009 13:57:26 -0700 (PDT) To: x...@shaw.ca I will investigate how to change the loglevel of postfix, because right now the error messages don't seem very helpful (at least to me). Cheers On Sat, Oct 24, 2009 at 1:27 PM, John Black s...@network-technologies.org wrote: James Prentice wrote: Also, I notice that in the mail.log file, the 'from:' value is 'www-d...@homemade'. The actual 'from:' value is provided to the php mail() function via a web form, so should be somebody's email address (e.g. my own in this case). I think PHP will use the apache user and domain to generate the email address. I use my own smtp function so I can't say for certain. One thing you could try is to use a valid email account on the server for the FROM address so that you can receive the bounced message. The actual message should contain more information. Alternatively attempt to increase the loglevel of postfix so you get exact feedback of why the connection is failing. As far as which server to use. I think this page lists the correct one: http://www.shaw.ca/en-ca/CustomerCare/InternetSupport/Residential/RoutersandShawServerNames.htm -- John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php mail() function
James Prentice wrote: It sends the bounced message to /var/mail/www-data and I get this: --19BE8A70109.1256417846/homemade Content-Description: Delivery report Content-Type: message/delivery-status Reporting-MTA: dns; homemade X-Postfix-Queue-ID: 19BE8A70109 X-Postfix-Sender: rfc822; www-d...@homemade Arrival-Date: Sat, 24 Oct 2009 13:57:26 -0700 (PDT) Final-Recipient: rfc822; x...@shaw.ca Action: failed Status: 5.0.0 Diagnostic-Code: X-Postfix; shawmail.vc.shawcable.net --19BE8A70109.1256417846/homemade Content-Description: Undelivered Message Content-Type: message/rfc822 Received: by homemade (Postfix, from userid 33) id 19BE8A70109; Sat, 24 Oct 2009 13:57:26 -0700 (PDT) To: x...@shaw.ca Although 5.0.0 actually means something else I'm pretty sure you are rejected because of an invalid sender address or domain. Use a sender address that is valid with your ISP's mail relay. Just my $0.02 -- per -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php mail() function
I also suspect that the problem is due to the sender address, but I have tried using the shaw email address for the From: address that's given to the mail() function and it still gets bounced. It seems like the ISP should consider that address valid. On Sat, Oct 24, 2009 at 2:20 PM, Per olof Ljungmark p...@bsdlabs.com wrote: James Prentice wrote: It sends the bounced message to /var/mail/www-data and I get this: --19BE8A70109.1256417846/homemade Content-Description: Delivery report Content-Type: message/delivery-status Reporting-MTA: dns; homemade X-Postfix-Queue-ID: 19BE8A70109 X-Postfix-Sender: rfc822; www-d...@homemade Arrival-Date: Sat, 24 Oct 2009 13:57:26 -0700 (PDT) Final-Recipient: rfc822; x...@shaw.ca Action: failed Status: 5.0.0 Diagnostic-Code: X-Postfix; shawmail.vc.shawcable.net --19BE8A70109.1256417846/homemade Content-Description: Undelivered Message Content-Type: message/rfc822 Received: by homemade (Postfix, from userid 33) id 19BE8A70109; Sat, 24 Oct 2009 13:57:26 -0700 (PDT) To: x...@shaw.ca Although 5.0.0 actually means something else I'm pretty sure you are rejected because of an invalid sender address or domain. Use a sender address that is valid with your ISP's mail relay. Just my $0.02 -- per -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php mail() function
But it seems like the 'From:' address being given to the PHP mail() function is maybe being ignored, because the error log lists 'www-d...@homemade' as being the sender, rather than listing the shaw address. The snippet from the PHP code: $email = $_POST['email']; ... mail($to, $subject, $msg, 'From:' . $email); I have tried setting both $to and $email to be the same shaw address since I assumed it should be recognized by the mail server, but it's still getting bounced. So why is 'www-d...@homemade' being listed as the sender? Any ideas? On Sat, Oct 24, 2009 at 9:17 PM, James Prentice prentice@gmail.com wrote: I also suspect that the problem is due to the sender address, but I have tried using the shaw email address for the From: address that's given to the mail() function and it still gets bounced. It seems like the ISP should consider that address valid. On Sat, Oct 24, 2009 at 2:20 PM, Per olof Ljungmark p...@bsdlabs.com wrote: James Prentice wrote: It sends the bounced message to /var/mail/www-data and I get this: --19BE8A70109.1256417846/homemade Content-Description: Delivery report Content-Type: message/delivery-status Reporting-MTA: dns; homemade X-Postfix-Queue-ID: 19BE8A70109 X-Postfix-Sender: rfc822; www-d...@homemade Arrival-Date: Sat, 24 Oct 2009 13:57:26 -0700 (PDT) Final-Recipient: rfc822; x...@shaw.ca Action: failed Status: 5.0.0 Diagnostic-Code: X-Postfix; shawmail.vc.shawcable.net --19BE8A70109.1256417846/homemade Content-Description: Undelivered Message Content-Type: message/rfc822 Received: by homemade (Postfix, from userid 33) id 19BE8A70109; Sat, 24 Oct 2009 13:57:26 -0700 (PDT) To: x...@shaw.ca Although 5.0.0 actually means something else I'm pretty sure you are rejected because of an invalid sender address or domain. Use a sender address that is valid with your ISP's mail relay. Just my $0.02 -- per -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php mail() function
i faced the same problem quite a few times. the general email route is php script - sender smtp server - receiving mail server in your case path 2 is broken. meaning port 25 is blocked by your ISP the work around is: 1. see if your ISP provides you with an SMTP account that is not blocked (OR) 2. try using a socks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php mail() function
Paul M Foster wrote: Regarding the rejection of dynamic IPs by smarthosts, are you saying that it's a blacklist of sorts that lets them know an IP is dynamic? (Serious question. I don't know the mechanism by which they determine what is and isn't a dynamic IP.) I run my own mail server and use the zen blocklist from spamhaus.org. The zen list combines all the the anti spam lists plus all IPs designated to end users (http://www.spamhaus.org/zen/) The reason for blocking end users is that a lot of SPAM is sent out by compromised machines from some home Internet connection. I am currently getting about 5 connections every 2 seconds from compromised computers attempting to spam my server. The origin is usually a dynamically assigned IP from Sprint or Comcast (USA ISPs). So blocking the end users from sending SPAM tends to cut down on a LOT of junk. Here is a bit more info about the end user blocklist. http://www.spamhaus.org/pbl/ -- John Question / Answer based CAPTCHA http://www.network-technologies.org/tiny.php?id=1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php mail() function
From: Paul M Foster Regarding the rejection of dynamic IPs by smarthosts, are you saying that it's a blacklist of sorts that lets them know an IP is dynamic? (Serious question. I don't know the mechanism by which they determine what is and isn't a dynamic IP.) You are talking about two different mechanisms here. The black or grey lists are services that track known open relays and other sources of spam, viruses and assorted malware. Anyone can subscribe to them and use them to validate relay requests. There are also services that keep track of valid domain addresses and the IP assigned to them. They are usually called DNS hosts. These can be polled to identify the IP address for authorized domains and hosts. There are even special records for the email severs within a domain. Most dynamically allocated IP addresses will not show up on these servers unless you have access to a service authorized to inject records. So basically, qmail did a DNS lookup on your host/domain name and did not find a record pointing to your server. Therefore it rejected your request. You will have to ask your ISP for the address of their SMTP and POP servers if you don't know them. But usually your email client is already configured to talk to them. I would just go into my Thunderbird setup and look up those addresses. Bob McConnell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php mail() function
I found the mail server for my ISP (shawmail.vc.shawcable.net) and edited main.cf in the following manner: myhostname = shawcable.net relayhost = [shawmail.vc.shawcable.net] I still don't receive the mail from the PHP script though. The error log from /var/log/mail.log is this: Oct 23 21:00:31 homemade postfix/pickup[7044]: 6CA44A70109: uid=33 from=www-data Oct 23 21:00:31 homemade postfix/cleanup[7107]: 6CA44A70109: message-id=20091024040031.6ca44a70...@shawcable.net Oct 23 21:00:31 homemade postfix/qmgr[7045]: 6CA44A70109: from=www-d...@shawcable.net, size=527, nrcpt=1 (queue active) Oct 23 21:00:31 homemade postfix/error[7109]: 6CA44A70109: to=x...@gmail.com, relay=none, delay=0.04, delays=0.03/0/0/0.01, dsn=5.0.0, status=bounced ([shawmail.vc.shawcable.net]) Oct 23 21:00:31 homemade postfix/cleanup[7107]: 75517A7010A: message-id=20091024040031.75517a70...@shawcable.net Oct 23 21:00:31 homemade postfix/bounce[7110]: 6CA44A70109: sender non-delivery notification: 75517A7010A Oct 23 21:00:31 homemade postfix/qmgr[7045]: 75517A7010A: from=, size=2219, nrcpt=1 (queue active) Oct 23 21:00:31 homemade postfix/qmgr[7045]: 6CA44A70109: removed Oct 23 21:00:31 homemade postfix/error[7109]: 75517A7010A: to=www-d...@shawcable.net, relay=none, delay=0.03, delays=0.02/0/0/0.01, dsn=5.0.0, status=bounced ([shawmail.vc.shawcable.net]) Oct 23 21:00:31 homemade postfix/qmgr[7045]: 75517A7010A: removed Have I edited main.cf incorrectly, or are there other values that need to be edited? Cheers On Thu, Oct 22, 2009 at 6:24 PM, James Prentice prentice@gmail.com wrote: How would I determine my ISP's SMPT server ID? And do I need to edit main.cf in order to use that server? Also, is there a way to test the script just sending an email locally? I tried sending the email to use...@localhost, but the email was still not received. On Thu, Oct 22, 2009 at 4:15 PM, LinuxManMikeC linuxmanmi...@gmail.com wrote: The problem is you won't be trusted to deliver mail directly to most mail servers unless you have a static IP. Even then thats no guarantee. What you have to do is relay through your ISP's SMTP server where you're trusted. You should also be able to setup PHP to use your ISP's SMTP server and never touch the SMTP service on your local machine (if you don't feel like playing with Postfix). On Thu, Oct 22, 2009 at 3:56 PM, James Prentice prentice@gmail.com wrote: I'm trying to use the php mail() function to send a mail within a php script. This is using PHP 5.2.4 and Ubuntu Hardy Heron linux. The script runs fine and the return value of the mail function is TRUE, but the mail is never received. I'm trying to send an email to my gmail account via the local server on my machine, just to test if this script works. I installed postfix because I read in several places that people have had good luck with that mail program. From what I can tell, postfix is working. I can do: telnet localhost 25 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. 220 homemade ESMTP Postfix (Ubuntu) ehlo localhost 250-homemade 250-PIPELINING 250-SIZE 1024 250-VRFY 250-ETRN 250-STARTTLS 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN After the php script runs, I type 'mailq' and get the result 'mail queue is empty.' If I check /var/log/mail.log, this is what I see: Oct 21 23:54:35 homemade postfix/pickup[5735]: 2A31EA70109: uid=33 from=www-data Oct 21 23:54:35 homemade postfix/cleanup[7997]: 2A31EA70109: message-id=20091022065435.2a31ea70...@homemade Oct 21 23:54:35 homemade postfix/qmgr[5736]: 2A31EA70109: from=www-d...@homemade, size=499, nrcpt=1 (queue active) Oct 21 23:54:35 homemade postfix/error[7999]: 2A31EA70109: to=x...@gmail.com, relay=none, delay=0.04, delays=0.03/0/0/0.01, dsn=5.0.0, status=bounced (gmail.com) Oct 21 23:54:35 homemade postfix/cleanup[7997]: 3217DA7010A: message-id=20091022065435.3217da70...@homemade Oct 21 23:54:35 homemade postfix/qmgr[5736]: 3217DA7010A: from=, size=2095, nrcpt=1 (queue active) Oct 21 23:54:35 homemade postfix/bounce[8000]: 2A31EA70109: sender non-delivery notification: 3217DA7010A Oct 21 23:54:35 homemade postfix/qmgr[5736]: 2A31EA70109: removed Oct 21 23:54:35 homemade postfix/local[8001]: 3217DA7010A: to=www-d...@homemade, relay=local, delay=0.03, delays=0/0.02/0/0.01, dsn=2.0.0, status=sent (delivered to command: procmail -a $EXTENSION) Oct 21 23:54:35 homemade postfix/qmgr[5736]: 3217DA7010A: removed Any ideas? I am new both to php and postfix. Thanks for any help. -- 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] php mail() function
i never worked with postfix, but form my experience with hmail server i can say that you need to relay through a mail account of ISP(not the server itself) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php mail() function
On Fri, Oct 23, 2009 at 09:11:25PM -0700, James Prentice wrote: I found the mail server for my ISP (shawmail.vc.shawcable.net) and edited main.cf in the following manner: myhostname = shawcable.net relayhost = [shawmail.vc.shawcable.net] I still don't receive the mail from the PHP script though. The error log from /var/log/mail.log is this: Oct 23 21:00:31 homemade postfix/pickup[7044]: 6CA44A70109: uid=33 from=www-data Oct 23 21:00:31 homemade postfix/cleanup[7107]: 6CA44A70109: message-id=20091024040031.6ca44a70...@shawcable.net Oct 23 21:00:31 homemade postfix/qmgr[7045]: 6CA44A70109: from=www-d...@shawcable.net, size=527, nrcpt=1 (queue active) Oct 23 21:00:31 homemade postfix/error[7109]: 6CA44A70109: to=x...@gmail.com, relay=none, delay=0.04, delays=0.03/0/0/0.01, dsn=5.0.0, status=bounced ([shawmail.vc.shawcable.net]) Oct 23 21:00:31 homemade postfix/cleanup[7107]: 75517A7010A: message-id=20091024040031.75517a70...@shawcable.net Oct 23 21:00:31 homemade postfix/bounce[7110]: 6CA44A70109: sender non-delivery notification: 75517A7010A Oct 23 21:00:31 homemade postfix/qmgr[7045]: 75517A7010A: from=, size=2219, nrcpt=1 (queue active) Oct 23 21:00:31 homemade postfix/qmgr[7045]: 6CA44A70109: removed Oct 23 21:00:31 homemade postfix/error[7109]: 75517A7010A: to=www-d...@shawcable.net, relay=none, delay=0.03, delays=0.02/0/0/0.01, dsn=5.0.0, status=bounced ([shawmail.vc.shawcable.net]) Oct 23 21:00:31 homemade postfix/qmgr[7045]: 75517A7010A: removed Have I edited main.cf incorrectly, or are there other values that need to be edited? 1. Not sure why you have square brackets around the relayhost value. 2. You're getting a bounce from the ISP's mail server, one indicating it still won't allow relay. 3. I suspect the relayhost name is wrong. This may be the name you find in the mail headers on messages relayed to you, but I doubt it's the one you should use to post to. I could be wrong, though. 4. All due respect to Kranthi, but I believe he's wrong about relaying mail from your webserver to the ISP's mailserver. I believe the ISP's mailserver doesn't care, as long as the mail comes from your pipe. You could probably call yourself pi...@pepperoni.com and your ISP would accept it. It's just the From:. Again, I could be wrong. 5. This would be a lot simpler if you just call Shaw and ask them for the name of the mailserver, and ask them if it's a problem for you to post mail from your internal webserver to their mailserver. Then ask them why such posts might bounce with a 5XX error. Paul Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php mail() function
On Thu, Oct 22, 2009 at 06:24:14PM -0700, James Prentice wrote: How would I determine my ISP's SMPT server ID? And do I need to edit main.cf in order to use that server? What ID? There's no ID needed. You just configure postfix to relay any non-local mail sent to it to the SMTP server at your ISP. Check the headers in incoming mail sent to you for the name of that server. It's likely the same for both incoming and outgoing mail. Something like mail.myisp.com. One other note. People look at me like I'm crazy when I mention this, but I've seen it quite a bit at various internet mail servers. Sometimes, in order to accept email from you, the internet mail server must see you *receive* mail within a certain time period prior. That is, you have to go fetch your mail at the ISP, which opens a window into the SMTP server for a limited time. Then you can tender mail to the internet mail server. I don't know that your internet mail server operates this way, but it's something to consider. I've had to deal with this before myself. Configuring local SMTP servers, like postfix. Check and see if Ubuntu has some sort of setup utility for this. Or try dpkg-reconfigure postfix Setting up mail servers is tedious and error prone, unless you've done it a lot. Read The Fine Manual on postfix. Also, is there a way to test the script just sending an email locally? I tried sending the email to use...@localhost, but the email was still not received. It will work, assuming three things: 1. You have an actual user set up on the system to receive mail. That is, an actual user on the system, with an entry in the passwd file and a home directory, etc. 2. Postfix is configured to deliver truly local mail to local addresses. More postfix configuration fun. 3. Postfix is actually running and properly configured. If not configured properly, it may refuse to run. In any case, linuxmanmikec's comment about the internet mail server not trusting you on a dynamic IP is spot on. The web of email trust is such that internet mail servers only trust other internet mail servers. And *your* internet mail server will trust *you*. So to get mail to that other internet mail server over there, you'll have to give it to *your* internet mail server, which is the only one that internet mail server over there will trust. The bounce message you got indicates that relaying from you is forbidden at the destination mail server. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php mail() function
Paul M Foster wrote: On Thu, Oct 22, 2009 at 06:24:14PM -0700, James Prentice wrote: One other note. People look at me like I'm crazy when I mention this, but I've seen it quite a bit at various internet mail servers. Sometimes, in order to accept email from you, the internet mail server must see you *receive* mail within a certain time period prior. That is, you have to go fetch your mail at the ISP, which opens a window into the SMTP server for a limited time. Then you can tender mail to the internet mail server. I don't know that your internet mail server operates this way, but it's something to consider. I've had to deal with this before myself. This is commonly known as POP lock and is one of the two main ways that a mail server allows you to relay a message. If you have authenticated via POP3 (i.e. checked your mail) in a certain period of time then the SMTP server will let you send. The other main one is by authentication (username/password) with the SMTP server when you attempt to send mail. In any case, linuxmanmikec's comment about the internet mail server not trusting you on a dynamic IP is spot on. The web of email trust is such that internet mail servers only trust other internet mail servers. And *your* internet mail server will trust *you*. So to get mail to that other internet mail server over there, you'll have to give it to *your* internet mail server, which is the only one that internet mail server over there will trust. The bounce message you got indicates that relaying from you is forbidden at the destination mail server. This is fairly accurate in premise but just to clarify. Mailservers don't operate like this by default and there is really no trust. There are public blacklists that a mailserver can be configured to use that tell the mailserver not to accept mail from servers on the blacklist. The blacklists may contain servers that allow anyone to relay email, compromised servers, servers known for spam, ip ranges known to be held by spammers and *ranges that ISPs designate as dynamic or used for subscribers (DSL, cable, dial-up customers, etc. because they shouldn't be relaying email). -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php mail() function
On Thu, Oct 22, 2009 at 11:40:34PM -0500, Shawn McKenzie wrote: snip This is fairly accurate in premise but just to clarify. Mailservers don't operate like this by default and there is really no trust. There are public blacklists that a mailserver can be configured to use that tell the mailserver not to accept mail from servers on the blacklist. The blacklists may contain servers that allow anyone to relay email, compromised servers, servers known for spam, ip ranges known to be held by spammers and *ranges that ISPs designate as dynamic or used for subscribers (DSL, cable, dial-up customers, etc. because they shouldn't be relaying email). Regarding the rejection of dynamic IPs by smarthosts, are you saying that it's a blacklist of sorts that lets them know an IP is dynamic? (Serious question. I don't know the mechanism by which they determine what is and isn't a dynamic IP.) Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP Mail Function
On Sat, 2009-06-20 at 20:30 -0600, David Swenson wrote: Julian, From my understanding of PHP's mail() function, it doesn't do anything more than send to the address you specified. On that note, I'd check things like: Email address typos The email your sending to your domain, is it already being forwarded? If so, do you get the email at your gmail account? If it's not being forwarded, add $additionalheaders to your script and CC: your gmail account when sending to your domain. See if it shows up there. Anyway those are somethings you could try as you have supplied no code to check syntax and/or given any other testing you've tried. Good Luck, David -Original Message- From: Julian Muscat Doublesin [mailto:opensourc...@gmail.com] Sent: Saturday, June 20, 2009 1:59 PM To: php-general@lists.php.net Subject: [PHP] PHP Mail Function Hello Everyone, I have written an e-mail function that sends e-mail to my domain that forwards it to a gmail account. When I use the gmail address directly it works fine. When I use my mail domain i don't get anything. Has anyone experienced this? Can anyone give me some advice? Thanks in advance Julian No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.364 / Virus Database: 270.12.81/2189 - Release Date: 06/20/09 06:15:00 I had this problem before, and it seems that spam filters of all descriptions were the culprit. Thanks Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Mail Function
Hello Everyone, I have written an e-mail function that sends e-mail to my domain that forwards it to a gmail account. When I use the gmail address directly it works fine. When I use my mail domain i don't get anything. Has anyone experienced this? Can anyone give me some advice? Thanks in advance Julian
RE: [PHP] PHP Mail Function
Julian, From my understanding of PHP's mail() function, it doesn't do anything more than send to the address you specified. On that note, I'd check things like: Email address typos The email your sending to your domain, is it already being forwarded? If so, do you get the email at your gmail account? If it's not being forwarded, add $additionalheaders to your script and CC: your gmail account when sending to your domain. See if it shows up there. Anyway those are somethings you could try as you have supplied no code to check syntax and/or given any other testing you've tried. Good Luck, David -Original Message- From: Julian Muscat Doublesin [mailto:opensourc...@gmail.com] Sent: Saturday, June 20, 2009 1:59 PM To: php-general@lists.php.net Subject: [PHP] PHP Mail Function Hello Everyone, I have written an e-mail function that sends e-mail to my domain that forwards it to a gmail account. When I use the gmail address directly it works fine. When I use my mail domain i don't get anything. Has anyone experienced this? Can anyone give me some advice? Thanks in advance Julian No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.364 / Virus Database: 270.12.81/2189 - Release Date: 06/20/09 06:15:00 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mail function and hotmail
Hello, Thank you all for your cooperation yesterday. I tried PEAR Mail_mime as follows: function SendEmail($template, $params){ // Read and open the template file and the image file $htmlFile = fopen(./templates/$template.html, r); $txtFile = fopen(./templates/$template.txt, r); $htmlMsg = fread($htmlFile, filesize(./templates/$template.html)); $textMsg = fread($txtFile, filesize(./templates/$template.txt)); // Replace the template values foreach($params as $key = $value){ // Template values will always start with two hash marks ## if(substr($key, 0, 2) == ##){ $htmlMsg = str_replace($key, $value, $htmlMsg); $textMsg = str_replace($key, $value, $textMsg); } } // Create the appropiate headers $headers = array( From = n...@domain.ca, Reply-To = n...@domain.ca, Subject = $params[subject], Organization = Name ); // Create the mime object $mime = new Mail_mime(); $mime-setTxtBody($textMsg); $mime-setHTMLBody($htmlMsg); $mime-addHTMLImage(templates/emaillogo.jpg, image/jpg, templates/emaillogo.jpg); // Set the variables for the Mail object to send the message $body = $mime-get(); $headers = $mime-headers($headers); $mail = Mail::factory(mail); return $mail-send($params[email], $headers, $body); } However, hotmail is still getting blank emails when I sent them from my production machine (CentOS 5.3), however, when I send the message from my development machine (Visata Ultimate SP1) it does work correctly on hotmail address . Both machines are running php 5.2 and have the same PEAR packages. I tried Gmail, Yahoo mail and Thunderbird and they work fine. Your help will be much appreciated. Thank you, Fernando. Date: Wed, 10 Jun 2009 23:14:11 +0530 From: sudhee...@binaryvibes.co.in To: phps...@gmail.com CC: jfer...@hotmail.com; rich...@php.net; php-general@lists.php.net Subject: Re: [PHP] Mail function and hotmail Richard was likely suggestion his mail example as listed in his signature Other options include phpmailer pear's mime mail various other classes available www.phpclasses.org Fernando, I recommend you check out the various PHP frameworks out there. Instead of randomly searching for classes for common functionality like sending an email from your script, you could use the framework's classes. I am sure all of the frameworks provide classes to send emails. The next time you need a class to read email from your scripts, you can simply look for classes your framework of choice provides. I personally use Zend Framework. But there are many available - Cake, CI, Symphony, etc. Also take a look at PEAR like Bastien said. -- With warm regards, Sudheer. S Business: http://binaryvibes.co.in, Tech stuff: http://techchorus.net, Personal: http://sudheer.net _ Attention all humans. We are your photos. Free us. http://go.microsoft.com/?linkid=9666046
RE: [PHP] Mail function and hotmail
I decided to change the call to send to: $mail = Mail::factory(smtp, array(host = localhost)); return $mail-send($params[email], $headers, $body); and now hotmail wokrs. Maybe qmail changes something when the mail() function is used. Thank you for all your help. Fernando. From: jfer...@hotmail.com To: sudhee...@binaryvibes.co.in; phps...@gmail.com CC: rich...@php.net; php-general@lists.php.net Date: Thu, 11 Jun 2009 10:34:13 -0400 Subject: RE: [PHP] Mail function and hotmail Hello, Thank you all for your cooperation yesterday. I tried PEAR Mail_mime as follows: function SendEmail($template, $params){ // Read and open the template file and the image file $htmlFile = fopen(./templates/$template.html, r); $txtFile = fopen(./templates/$template.txt, r); $htmlMsg = fread($htmlFile, filesize(./templates/$template.html)); $textMsg = fread($txtFile, filesize(./templates/$template.txt)); // Replace the template values foreach($params as $key = $value){ // Template values will always start with two hash marks ## if(substr($key, 0, 2) == ##){ $htmlMsg = str_replace($key, $value, $htmlMsg); $textMsg = str_replace($key, $value, $textMsg); } } // Create the appropiate headers $headers = array( From = n...@domain.ca, Reply-To = n...@domain.ca, Subject = $params[subject], Organization = Name ); // Create the mime object $mime = new Mail_mime(); $mime-setTxtBody($textMsg); $mime-setHTMLBody($htmlMsg); $mime-addHTMLImage(templates/emaillogo.jpg, image/jpg, templates/emaillogo.jpg); // Set the variables for the Mail object to send the message $body = $mime-get(); $headers = $mime-headers($headers); $mail = Mail::factory(mail); return $mail-send($params[email], $headers, $body); } However, hotmail is still getting blank emails when I sent them from my production machine (CentOS 5.3), however, when I send the message from my development machine (Visata Ultimate SP1) it does work correctly on hotmail address . Both machines are running php 5.2 and have the same PEAR packages. I tried Gmail, Yahoo mail and Thunderbird and they work fine. Your help will be much appreciated. Thank you, Fernando. Date: Wed, 10 Jun 2009 23:14:11 +0530 From: sudhee...@binaryvibes.co.in To: phps...@gmail.com CC: jfer...@hotmail.com; rich...@php.net; php-general@lists.php.net Subject: Re: [PHP] Mail function and hotmail Richard was likely suggestion his mail example as listed in his signature Other options include phpmailer pear's mime mail various other classes available www.phpclasses.org Fernando, I recommend you check out the various PHP frameworks out there. Instead of randomly searching for classes for common functionality like sending an email from your script, you could use the framework's classes. I am sure all of the frameworks provide classes to send emails. The next time you need a class to read email from your scripts, you can simply look for classes your framework of choice provides. I personally use Zend Framework. But there are many available - Cake, CI, Symphony, etc. Also take a look at PEAR like Bastien said. -- With warm regards, Sudheer. S Business: http://binaryvibes.co.in, Tech stuff: http://techchorus.net, Personal: http://sudheer.net _ Attention all humans. We are your photos. Free us. http://go.microsoft.com/?linkid=9666046 _ We are your photos. Share us now with Windows Live Photos. http://go.microsoft.com/?linkid=9666047
[PHP] Mail function and hotmail
Hello, I am sending an html message with and embedded image using the following code: // Read message from html template $message = fread(template.html, filesize(template.html)); // I replace the values in $message that are necessary to // fill the tempalte ... // Generate a boundary string $rand_value = md5(time()); $mime_boundary = -$rand_value; $headers = MIME-Version: 1.0\r\n; $headers .= From: Name n...@domain.com\r\n; $headers .= Reply-To: Name n...@domain.com\r\n; $headers .= Return-Path: n...@domain.com\r\n; $headers .= Organization: Name\r\n; $headers .= X-Mailer: PHP's mail() Function\r\n; $headers .= Content-Type: multipart/related; ; $headers .= boundary=\$mime_boundary\; type=\text/html\\r\n\r\n; $body = This is a multi-part message in MIME format.\r\n; $body .= --$mime_boundary\r\n; $body .= Content-Type: text/html; charset=UTF-8\r\n; $body .= Content-Transfer-Encoding: 7bit\r\n\r\n$message\r\n\r\n; $body .= --$mime_boundary\r\n; $body .= Content-Type: image/jpg\r\n; $body .= Content-Transfer-Encoding: base64\r\n; $body .= Content-ID: ggtourslogo\r\n\r\n; $body .= chunk_split(base64_encode(file_get_contents(./templates/emaillogo.jpg))); $body .= --$mime_boundary--; return mail(em...@domain.com, Subject, $body, $headers); However when it is send to a hotmail.com address the message is received blank. It does work fine with Gmail, Yahoo mail, Outlook Express and Thunderbird. Your help is much appreciated. Fernando _ We are your photos. Share us now with Windows Live Photos. http://go.microsoft.com/?linkid=9666047
Re: [PHP] Mail function and hotmail
On Wed, 2009-06-10 at 12:59 -0400, Fernando G wrote: Hello, I am sending an html message with and embedded image using the following code: // Read message from html template $message = fread(template.html, filesize(template.html)); // I replace the values in $message that are necessary to // fill the tempalte ... // Generate a boundary string $rand_value = md5(time()); $mime_boundary = -$rand_value; $headers = MIME-Version: 1.0\r\n; $headers .= From: Name n...@domain.com\r\n; $headers .= Reply-To: Name n...@domain.com\r\n; $headers .= Return-Path: n...@domain.com\r\n; $headers .= Organization: Name\r\n; $headers .= X-Mailer: PHP's mail() Function\r\n; $headers .= Content-Type: multipart/related; ; $headers .= boundary=\$mime_boundary\; type=\text/html\\r\n\r\n; $body = This is a multi-part message in MIME format.\r\n; $body .= --$mime_boundary\r\n; $body .= Content-Type: text/html; charset=UTF-8\r\n; $body .= Content-Transfer-Encoding: 7bit\r\n\r\n$message\r\n\r\n; $body .= --$mime_boundary\r\n; $body .= Content-Type: image/jpg\r\n; $body .= Content-Transfer-Encoding: base64\r\n; $body .= Content-ID: ggtourslogo\r\n\r\n; $body .= chunk_split(base64_encode(file_get_contents(./templates/emaillogo.jpg))); $body .= --$mime_boundary--; return mail(em...@domain.com, Subject, $body, $headers); However when it is send to a hotmail.com address the message is received blank. It does work fine with Gmail, Yahoo mail, Outlook Express and Thunderbird. Your help is much appreciated. Fernando _ We are your photos. Share us now with Windows Live Photos. http://go.microsoft.com/?linkid=9666047 As far as I'm aware, Hotmail blocks all images by default. Also, I've seen Outlook choke on message with the \r\n line endings, could Hotmail be doing that too? Thanks Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail function and hotmail
Hi, ... Use something that is already proven to work. It will save you an awful lot of time. -- Richard Heyes HTML5 graphing: RGraph (www.rgraph.net - updated 6th June) PHP mail: RMail (www.phpguru.org/rmail) PHP datagrid: RGrid (www.phpguru.org/rgrid) PHP Template: RTemplate (www.phpguru.org/rtemplate) PHP SMTP: http://www.phpguru.org/smtp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mail function and hotmail
I have not idea of what else to use. Your suggestions are appreciated. Fernando. Date: Wed, 10 Jun 2009 18:04:31 +0100 From: rich...@php.net To: jfer...@hotmail.com CC: php-general@lists.php.net Subject: Re: [PHP] Mail function and hotmail Hi, ... Use something that is already proven to work. It will save you an awful lot of time. -- Richard Heyes HTML5 graphing: RGraph (www.rgraph.net - updated 6th June) PHP mail: RMail (www.phpguru.org/rmail) PHP datagrid: RGrid (www.phpguru.org/rgrid) PHP Template: RTemplate (www.phpguru.org/rtemplate) PHP SMTP: http://www.phpguru.org/smtp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Internet explorer 8 lets you browse the web faster. http://go.microsoft.com/?linkid=9655582
Re: [PHP] Mail function and hotmail
On Wed, Jun 10, 2009 at 1:11 PM, Fernando Gjfer...@hotmail.com wrote: I have not idea of what else to use. Your suggestions are appreciated. Fernando. Date: Wed, 10 Jun 2009 18:04:31 +0100 From: rich...@php.net To: jfer...@hotmail.com CC: php-general@lists.php.net Subject: Re: [PHP] Mail function and hotmail Hi, ... Use something that is already proven to work. It will save you an awful lot of time. -- Richard Heyes HTML5 graphing: RGraph (www.rgraph.net - updated 6th June) PHP mail: RMail (www.phpguru.org/rmail) PHP datagrid: RGrid (www.phpguru.org/rgrid) PHP Template: RTemplate (www.phpguru.org/rtemplate) PHP SMTP: http://www.phpguru.org/smtp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Internet explorer 8 lets you browse the web faster. http://go.microsoft.com/?linkid=9655582 Richard was likely suggestion his mail example as listed in his signature Other options include phpmailer pear's mime mail various other classes available www.phpclasses.org -- Bastien Cat, the other other white meat -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mail function and hotmail
Hi, pear's mime mail I believe I had a hand in that too. It's like a bad rash - it gets everywhere... :-) -- Richard Heyes HTML5 graphing: RGraph (www.rgraph.net - updated 6th June) PHP mail: RMail (www.phpguru.org/rmail) PHP datagrid: RGrid (www.phpguru.org/rgrid) PHP Template: RTemplate (www.phpguru.org/rtemplate) PHP SMTP: http://www.phpguru.org/smtp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Mail function and hotmail
Thanks. I'll check that out. Date: Wed, 10 Jun 2009 18:24:45 +0100 Subject: Re: [PHP] Mail function and hotmail From: rich...@php.net To: phps...@gmail.com CC: jfer...@hotmail.com; php-general@lists.php.net Hi, pear's mime mail I believe I had a hand in that too. It's like a bad rash - it gets everywhere... :-) -- Richard Heyes HTML5 graphing: RGraph (www.rgraph.net - updated 6th June) PHP mail: RMail (www.phpguru.org/rmail) PHP datagrid: RGrid (www.phpguru.org/rgrid) PHP Template: RTemplate (www.phpguru.org/rtemplate) PHP SMTP: http://www.phpguru.org/smtp _ Internet explorer 8 lets you browse the web faster. http://go.microsoft.com/?linkid=9655582