Re: [PHP] mail() function on Windows (WAMP Server)

2011-01-06 Thread Daniel Brown
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)

2011-01-06 Thread Daniel Brown
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)

2011-01-06 Thread David Armstrong
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)

2011-01-06 Thread Daniel Brown
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)

2011-01-06 Thread David Armstrong
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)

2011-01-06 Thread Daniel Brown
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

2010-04-21 Thread Peter Lind
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

2010-04-21 Thread Ken Guest
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

2010-04-21 Thread Alice Wei

 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

2010-04-21 Thread Alice Wei

 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

2010-04-21 Thread Ken Guest
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

2010-04-21 Thread Alice Wei


 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

2010-04-20 Thread Ken Guest
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

2010-04-20 Thread Alice Wei


 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

2010-04-20 Thread Peter Lind
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

2010-04-20 Thread Ashley Sheridan
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

2010-04-20 Thread Alice Wei


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

2010-04-20 Thread Alice Wei


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

2010-04-19 Thread Peter Lind
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

2010-04-19 Thread Alice Wei

  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

2010-04-19 Thread David McGlone
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



Re: [PHP] Mail Function Using PEAR Issues

2010-04-18 Thread Karl DeSaulniers

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

2010-04-18 Thread Kevin Kinsey

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

2010-04-18 Thread Alice Wei


 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

2010-04-18 Thread Karl DeSaulniers

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

2010-04-18 Thread Kevin Kinsey

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

2010-04-13 Thread Ashley Sheridan
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

2010-04-13 Thread Alice Wei


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

2010-04-13 Thread Ashley Sheridan
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

2010-04-12 Thread Peter Lind
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

2010-04-12 Thread Alice Wei


 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

2010-04-12 Thread Alexey Bovanenko
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

2010-04-12 Thread Alice Wei


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

2010-04-12 Thread Kevin Kinsey

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

2010-04-12 Thread Alice Wei






 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

2010-04-12 Thread Teus Benschop
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

2010-04-12 Thread kranthi
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

2010-04-12 Thread Kevin Kinsey

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

2010-04-12 Thread Alice Wei






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

2010-04-12 Thread Karl DeSaulniers

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

2010-04-12 Thread Alice Wei

 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

2010-04-12 Thread kranthi
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

2010-04-12 Thread Alice Wei

 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

2010-04-12 Thread Karl DeSaulniers

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

2010-04-12 Thread kranthi
when you install pear package Mail a file called Mail.php will be
installed into C:/xampp/php/PEAR
 Mail.php contains the class Mail. So getting a class not found error is 
 not possible..
are you sure you are doing require_once 'Mail.php' ?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Mail Function Problem

2010-04-11 Thread Kevin Kinsey

Alice Wei wrote:
Hi, 

I have an issue here where I see no PHP errors on my mail 

 function usage, and yet I am not getting the mail in the
 desired account. Here is what I have for my PHP code:


$headers = From: aj...@alumni.iu.edu;
$to = aj...@alumni.iu.edu ;
$subject = Comments Regarding My Studio;
$body = From: $your_name\n E-Mail: $email\n Reason Contact: $question\n Comments:\n 
$comments;
mail($to, $subject, $body,$headers);


I don't see any way for you to know if there are any errors.

Try this as a very basic start:

$headers = From: aj...@alumni.iu.edu;
$to = aj...@alumni.iu.edu ;
$subject = Comments Regarding My Studio;
$body = From: $your_name\n E-Mail: $email\n Reason Contact: $question\n Comments:\n 
$comments;
$success=mail($to, $subject, $body,$headers);

if ($success) {
   echo Mail was sent successfully!;
} else {
   echo Sending of mail failed!;
}




This is what I have in my PHP.ini:

[mail function]
; For Win32 only.
SMTP = smtp.live.com
smtp_port = 587

; For Win32 only.
sendmail_from = aj...@alumni.iu.edu

; For Unix only.  You may supply arguments as well (default: sendmail -t -i).
;sendmail_path =

; Force the addition of the specified parameters to be passed as extra 
parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =

Yet, I don't see any mail in my aj...@alumni.iu.edu Mailbox, can

 anyone on the list please give me some pointers on what I may have done wrong 
here?

Thanks for your help.


Thanks to the worldwide brotherhood of crooks known as spammers,
sending e-mail these days isn't nearly as easy as PHP makes it look.
You might wanna look into an errors-to header to help debug any
problems with sender authorization, bad ports, etc.

HTH,

KDK

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Mail Function In PHP

2010-03-10 Thread Michael Kubler
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

2010-03-08 Thread Richard Quadling
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

2010-03-08 Thread Teus Benschop
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

2010-03-08 Thread Richard Quadling
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

2010-03-08 Thread Richard Quadling
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

2010-03-08 Thread Ashley Sheridan
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

2010-03-08 Thread Marc Trudel
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

2010-03-08 Thread Teus Benschop
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

2010-03-08 Thread John Black

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

2010-03-08 Thread John Black

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

2010-03-08 Thread james . stojan
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



Re: [PHP] Mail Function In PHP

2010-03-06 Thread Devendra Jadhav
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

2010-03-06 Thread Kevin Kinsey

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



RE: [PHP] Mail function and hotmail

2009-06-11 Thread Fernando G

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

2009-06-11 Thread Fernando G

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

Re: [PHP] Mail function and hotmail

2009-06-10 Thread Ashley Sheridan
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

2009-06-10 Thread Richard Heyes
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

2009-06-10 Thread Fernando G

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

2009-06-10 Thread Bastien Koert
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

2009-06-10 Thread Richard Heyes
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

2009-06-10 Thread Fernando G

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

Re: [PHP] Mail function and hotmail

2009-06-10 Thread Sudheer Satyanarayana




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


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Mail function and hotmail

2009-06-10 Thread Fernando G

Thank you.  I'm looking at PEAR Mail_mime right now.  It seems promising.

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

2008-11-03 Thread Daniel P. Brown
On Mon, Nov 3, 2008 at 12:56 PM, Will W [EMAIL PROTECTED] wrote:

 What is the limitation of the max emails that the mail function can send to?

That's limited by three things:

1.) Server resource availability (RAM, CPU, bandwidth).
2.) Server configuration.
3.) Your ISP (some, such as GoDaddy, have a cap each month).

-- 
/Daniel P. Brown
http://www.parasane.net/
[EMAIL PROTECTED] || [EMAIL PROTECTED]
Ask me about our current hosting/dedicated server deals!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Mail Function

2008-11-03 Thread Andrew Ballard
On Mon, Nov 3, 2008 at 1:19 PM, Daniel P. Brown
[EMAIL PROTECTED] wrote:
 On Mon, Nov 3, 2008 at 12:56 PM, Will W [EMAIL PROTECTED] wrote:

 What is the limitation of the max emails that the mail function can send to?

That's limited by three things:

1.) Server resource availability (RAM, CPU, bandwidth).
2.) Server configuration.
3.) Your ISP (some, such as GoDaddy, have a cap each month).

Most shared hosting plans I've tried have a limit per hour.

Andrew

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mail function and headers

2008-03-13 Thread Alain Roger
Hi Chris,

interesting thing, but i get the following error message :
*Warning*: mail()
[function.mailhttp://test4.rogtek.com/common/function.mail]:
SAFE MODE Restriction in effect. The fifth parameter is disabled in SAFE
MODE. in */test4/common/sendmail.php* on line *119*

how can i solve this by only PHP ? i do not have access to web hosting
server or php.ini.
thx,
Alain.


On Thu, Mar 13, 2008 at 12:57 AM, Chris [EMAIL PROTECTED] wrote:


  as you can see my Return-Path is still pointing on the wrong direction
 :-(
  any other idea ?

 return-path is set with the 5th mail() param:

 mail($to, $subject, $body, $headers, '[EMAIL PROTECTED]');


 --
 Postgresql  php tutorials
 http://www.designmagick.com/




-- 
Alain

Windows XP SP2
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008


Re: [PHP] mail function and headers

2008-03-13 Thread Chris

Alain Roger wrote:

Hi Chris,

interesting thing, but i get the following error message :
*Warning*: mail() [function.mail 
http://test4.rogtek.com/common/function.mail]: SAFE MODE Restriction 
in effect. The fifth parameter is disabled in SAFE MODE. in 
*/test4/common/sendmail.php* on line *119*


how can i solve this by only PHP ? i do not have access to web hosting 
server or php.ini.


1 of 2 options.

1) Find another host with safe-mode disabled
2) Use something like phpmailer to send your emails through an smtp server

--
Postgresql  php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mail function and headers

2008-03-13 Thread Alain Roger
hiChris,

i've read several forums where this mail() function from PHP initial package
is not so great.
Therefore a lot of people use PHPMailer which is more convenient for that
purpose...especially more flexible.

thanks a lot for your help.

Alain

On Thu, Mar 13, 2008 at 8:35 AM, Chris [EMAIL PROTECTED] wrote:

 Alain Roger wrote:
  Hi Chris,
 
  interesting thing, but i get the following error message :
  *Warning*: mail() [function.mail
  http://test4.rogtek.com/common/function.mail]: SAFE MODE Restriction
  in effect. The fifth parameter is disabled in SAFE MODE. in
  */test4/common/sendmail.php* on line *119*
 
  how can i solve this by only PHP ? i do not have access to web hosting
  server or php.ini.

 1 of 2 options.

 1) Find another host with safe-mode disabled
 2) Use something like phpmailer to send your emails through an smtp server

 --
 Postgresql  php tutorials
 http://www.designmagick.com/




-- 
Alain

Windows XP SP2
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008


Re: [PHP] mail function and headers

2008-03-13 Thread Chris

Alain Roger wrote:

hiChris,

i've read several forums where this mail() function from PHP initial 
package is not so great.


mail() works fine.

phpmailer (and zendmailer, swiftmailer and other such packages) help you 
with things like:


- sending through an smtp server
- putting a multipart email together
- adding attachments
- embedding images in your email content

and a whole bunch of other stuff so you don't have to write the code to 
do all of that.


There's nothing fancy in any of them, and if you don't tell them to send 
through an smtp server, they use the normal mail() command (in most 
cases I think anyway).


--
Postgresql  php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mail function and headers

2008-03-12 Thread Daniel Brown
On Wed, Mar 12, 2008 at 10:28 AM, Alain Roger [EMAIL PROTECTED] wrote:
 Hi,

  i'm playing a little bit with the mail function from PHP 5.2.4 and email
  headers.
  here is a snippet of my code:

   $headers = 'From: '.$email. .$fromname.
   \r\n.'Reply-To:'.$email.\r\n.'X-Mailer: PHP/' . phpversion();

You have the From: header parameters reversed.  Try this:

?
$headers  = From: .$fromname. .$email.\r\n;
$headers .= Reply-To: .$email.\r\n;
$headers .= X-Mailer: PHP/.phpversion().\r\n;
/*

*/
?

-- 
/Dan

Daniel P. Brown
Senior Unix Geek
? while(1) { $me = $mind--; sleep(86400); } ?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mail function and headers

2008-03-12 Thread spacemarc
2008/3/12, Daniel Brown [EMAIL PROTECTED]:
 You have the From: header parameters reversed.  Try this:

  ?
  $headers  = From: .$fromname. .$email.\r\n;
  $headers .= Reply-To: .$email.\r\n;
  $headers .= X-Mailer: PHP/.phpversion().\r\n;
  /*
 
  */
  ?

you can add these headers:

$header = From: $fromname$email\n;
$header .= Reply-To: $email\n;
$header .= Return-Path: $email\n;
$header .= X-Mailer: PHP/ . phpversion() . \n;
$header .= MIME-Version: 1.0\n;
$header .= Content-type: text/plain; charset=iso-8859-1\n;
$header .= Content-Transfer-encoding: 7bit\n;

Try it.

-- 
Scripts: http://www.spacemarc.it

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mail function and headers

2008-03-12 Thread Alain Roger
ok i will try... what about UTF-8 to ensure unicode ?
my website and especially the form which will send this email, will be
filled in by several nationalities... spanish, english, french, slovak,
german,,...
so isn't it easier to set up utf-8 ?

A.

On Wed, Mar 12, 2008 at 4:11 PM, spacemarc [EMAIL PROTECTED] wrote:

 2008/3/12, Daniel Brown [EMAIL PROTECTED]:
  You have the From: header parameters reversed.  Try this:
 
   ?
   $headers  = From: .$fromname. .$email.\r\n;
   $headers .= Reply-To: .$email.\r\n;
   $headers .= X-Mailer: PHP/.phpversion().\r\n;
   /*
  
   */
   ?

 you can add these headers:

 $header = From: $fromname$email\n;
 $header .= Reply-To: $email\n;
 $header .= Return-Path: $email\n;
 $header .= X-Mailer: PHP/ . phpversion() . \n;
 $header .= MIME-Version: 1.0\n;
 $header .= Content-type: text/plain; charset=iso-8859-1\n;
 $header .= Content-Transfer-encoding: 7bit\n;

 Try it.

 --
 Scripts: http://www.spacemarc.it




-- 
Alain

Windows XP SP2
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008


Re: [PHP] mail function and headers

2008-03-12 Thread Alain Roger
ok, so this is what i got and it is still remaining... :-(

Received: from serdev ([127.0.0.1]) by home.com with MailEnable ESMTP; Wed,
 12 Mar 2008 16:40:18 +0100
 Date: Wed, 12 Mar 2008 16:40:18 +0100
 Subject: subject 3
 To: [EMAIL PROTECTED]
 From: raf, news [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 Return-Path: [EMAIL PROTECTED]
 X-Mailer: PHP/5.2.4
 MIME-Version: 1.0
 Content-type: text/plain; charset=iso-8859-1
 Content-Transfer-encoding: 7bit


as you can see my Return-Path is still pointing on the wrong direction :-(
any other idea ?

A.

On Wed, Mar 12, 2008 at 4:11 PM, spacemarc [EMAIL PROTECTED] wrote:

 2008/3/12, Daniel Brown [EMAIL PROTECTED]:
  You have the From: header parameters reversed.  Try this:
 
   ?
   $headers  = From: .$fromname. .$email.\r\n;
   $headers .= Reply-To: .$email.\r\n;
   $headers .= X-Mailer: PHP/.phpversion().\r\n;
   /*
  
   */
   ?

 you can add these headers:

 $header = From: $fromname$email\n;
 $header .= Reply-To: $email\n;
 $header .= Return-Path: $email\n;
 $header .= X-Mailer: PHP/ . phpversion() . \n;
 $header .= MIME-Version: 1.0\n;
 $header .= Content-type: text/plain; charset=iso-8859-1\n;
 $header .= Content-Transfer-encoding: 7bit\n;

 Try it.

 --
 Scripts: http://www.spacemarc.it




-- 
Alain

Windows XP SP2
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008


Re: [PHP] mail function and headers

2008-03-12 Thread Chris



as you can see my Return-Path is still pointing on the wrong direction :-(
any other idea ?


return-path is set with the 5th mail() param:

mail($to, $subject, $body, $headers, '[EMAIL PROTECTED]');


--
Postgresql  php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mail() function HELP

2008-03-04 Thread Stut

On 4 Mar 2008, at 21:18, Sofia Jacob (CA) wrote:

I'm getting problems with the mail() function.

ERROR:

Warning: mail() [function.mail]: Failed to connect to mailserver at  
 port 25, verify your SMTP and smtp_port setting in php.ini or  
use ini_set() in C:\wamp\www\php_sandbox\user_auth_fns.php on line 170



I'm using Windows XP prof. and WAMP5 -server

Here what I did:

1) I download sendmail.zip from http://glob.com.au/sendmail/

2) I unzip this in a folder on c:\wamp\sendmail

3) I edited  PHP.INI file

[mail function]
; For Win32 only.
SMTP =
smtp_port =

; For Win32 only.
;sendmail_from =

; For Unix only.  You may supply arguments as well (default:  
sendmail -t -i).

;sendmail_path = C:\wamp\sendmail\sendmail.exe -t


I don't mean to be rude, but what part of For Unix only confused you?

You need to point the For Win32 only settings at a mail server on  
Windows. The error message pretty clearly states that it's trying to  
connect to the server specified in those settings.


-Stut

--
http://stut.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mail() function HELP

2008-03-04 Thread Shawn McKenzie
Stut wrote:
 On 4 Mar 2008, at 21:18, Sofia Jacob (CA) wrote:
 I'm getting problems with the mail() function.

 ERROR:

 Warning: mail() [function.mail]: Failed to connect to mailserver at 
 port 25, verify your SMTP and smtp_port setting in php.ini or use
 ini_set() in C:\wamp\www\php_sandbox\user_auth_fns.php on line 170


 I'm using Windows XP prof. and WAMP5 -server

 Here what I did:

 1) I download sendmail.zip from http://glob.com.au/sendmail/

 2) I unzip this in a folder on c:\wamp\sendmail

 3) I edited  PHP.INI file

 [mail function]
 ; For Win32 only.
 SMTP =
 smtp_port =

 ; For Win32 only.
 ;sendmail_from =

 ; For Unix only.  You may supply arguments as well (default: sendmail
 -t -i).
 ;sendmail_path = C:\wamp\sendmail\sendmail.exe -t
 
 I don't mean to be rude, but what part of For Unix only confused you?
 
 You need to point the For Win32 only settings at a mail server on
 Windows. The error message pretty clearly states that it's trying to
 connect to the server specified in those settings.
 
 -Stut
 
Uh, yeah...  Then I thought, why not just use the  SMTP and smtp_port
settings.

-Shawn

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mail() function HELP

2008-03-04 Thread Stut
Please include the list when replying. And please don't top-post, it  
makes proper quoting difficult.


On 4 Mar 2008, at 22:10, Sofia Jacob (CA) wrote:

Yes, I did that first and I get the error:

Warning: mail() [function.mail]: Failed to connect to mailserver at   
mail.yahoo.ca port 465, verify your SMTP and smtp_port setting  
in php.ini or  use ini_set() in C:\wamp\www\php_sandbox 
\user_auth_fns.php on line 170
(I should told you that before, sorry!!) and then I started to look  
at php web site and I found:


sendmail_path string
Where the sendmail program can be found, usually /usr/sbin/sendmail  
or /usr/lib/sendmail. configure does an honest attempt of locating  
this one for you and set a default, but if it fails, you can set it  
here.


Systems not using sendmail should set this directive to the sendmail  
wrapper/replacement their mail system offers, if any. For example, »  
Qmail users can normally set it to /var/qmail/bin/sendmail or/var/ 
qmail/bin/qmail-inject.


qmail-inject does not require any option to process mail correctly.

This directive works also under Windows. If set, smtp, smtp_port and  
sendmail_from are ignored and the specified command is executed.


My mistake, the comments in the INI file really should be changed to  
reflect that.


Given that your problem is that you haven't uncommented that line as  
Shawn said. Remove the ; from the start of that line, restart your we  
server and if the manual isn't lying it should work.


Incidentally, it probably didn't like the Yahoo settings you used  
because that port is for SMTP over SSL which PHP doesn't support.


-Stut

--
http://stut.net/


- Original Message -
From: Stut [EMAIL PROTECTED]
To: Sofia Jacob (CA) [EMAIL PROTECTED]
Cc: php-general@lists.php.net
Sent: Tuesday, March 04, 2008 4:57 PM
Subject: Re: [PHP] mail() function HELP

 On 4 Mar 2008, at 21:18, Sofia Jacob (CA) wrote:
 I'm getting problems with the mail() function.

 ERROR:

 Warning: mail() [function.mail]: Failed to connect to mailserver at
  port 25, verify your SMTP and smtp_port setting in php.ini  
or
 use ini_set() in C:\wamp\www\php_sandbox\user_auth_fns.php on  
line 170



 I'm using Windows XP prof. and WAMP5 -server

 Here what I did:

 1) I download sendmail.zip from http://glob.com.au/sendmail/

 2) I unzip this in a folder on c:\wamp\sendmail

 3) I edited  PHP.INI file

 [mail function]
 ; For Win32 only.
 SMTP =
 smtp_port =

 ; For Win32 only.
 ;sendmail_from =

 ; For Unix only.  You may supply arguments as well (default:
 sendmail -t -i).
 ;sendmail_path = C:\wamp\sendmail\sendmail.exe -t

 I don't mean to be rude, but what part of For Unix only confused  
you?


 You need to point the For Win32 only settings at a mail server on
 Windows. The error message pretty clearly states that it's trying to
 connect to the server specified in those settings.

 -Stut

 --
 http://stut.net/



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mail() function HELP

2008-03-04 Thread Shawn McKenzie
Stut wrote:
 Please include the list when replying. And please don't top-post, it
 makes proper quoting difficult.
 
 On 4 Mar 2008, at 22:10, Sofia Jacob (CA) wrote:
 Yes, I did that first and I get the error:

 Warning: mail() [function.mail]: Failed to connect to mailserver at 
 mail.yahoo.ca port 465, verify your SMTP and smtp_port setting
 in php.ini or  use ini_set() in
 C:\wamp\www\php_sandbox\user_auth_fns.php on line 170
 (I should told you that before, sorry!!) and then I started to look at
 php web site and I found:

 sendmail_path string
 Where the sendmail program can be found, usually /usr/sbin/sendmail or
 /usr/lib/sendmail. configure does an honest attempt of locating this
 one for you and set a default, but if it fails, you can set it here.

 Systems not using sendmail should set this directive to the sendmail
 wrapper/replacement their mail system offers, if any. For example, »
 Qmail users can normally set it to /var/qmail/bin/sendmail
 or/var/qmail/bin/qmail-inject.

 qmail-inject does not require any option to process mail correctly.

 This directive works also under Windows. If set, smtp, smtp_port and
 sendmail_from are ignored and the specified command is executed.

 My mistake, the comments in the INI file really should be changed to
 reflect that.
 
 Given that your problem is that you haven't uncommented that line as
 Shawn said. Remove the ; from the start of that line, restart your we
 server and if the manual isn't lying it should work.
 
 Incidentally, it probably didn't like the Yahoo settings you used
 because that port is for SMTP over SSL which PHP doesn't support.
 
 -Stut
 
Correct on the yahoo.  I would tend to doubt that allow open relaying as
well.

-Shawn

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Mail function doesn't work

2007-11-05 Thread Jay Blanchard
[snip]
What could happen that my mail function isn't working. I check twice my php.ini 
conf and it's fine. I test sendmail manually and it's OK. I also try to send 
mails with sendmail stoped and started and nothing happen
[/snip]

Can we see your code?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Mail function doesn't work

2007-11-05 Thread Per Jessen
Alberto García Gómez wrote:

 What could happen that my mail function isn't working. I check twice
 my php.ini conf and it's fine. I test sendmail manually and it's OK. I
 also try to send mails with sendmail stoped and started and nothing
 happen

Does your mail-server otherwise work?  


/Per Jessen, Zürich

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Mail function doesn't work

2007-11-05 Thread Jim Lucas

Alberto García Gómez wrote:

What could happen that my mail function isn't working. I check twice my php.ini 
conf and it's fine. I test sendmail manually and it's OK. I also try to send 
mails with sendmail stoped and started and nothing happen

Este correo ha sido enviado desde el Politécnico de Informática Carlos Marx 
de Matanzas.
La gran batalla se librará en el campo de las ideas


is your apache process chroot'ed ?

Can PHP see the sendmail binary?

--
Jim Lucas

   Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them.

Twelfth Night, Act II, Scene V
by William Shakespeare

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mail function

2007-08-02 Thread Siavash Miri
Check to see if you can send mail out of your server aside from the php 
script. Also, check the logs: error_log, maillog, messages  to see what's 
wrong with the script or the mail function. I'm not sure if these logs exist 
on IIS or where they are.


Siavash

- Original Message - 
From: Animesh Joshi [EMAIL PROTECTED]

To: php-general@lists.php.net
Sent: Wednesday, August 01, 2007 3:20 AM
Subject: [PHP] mail function


I've installed IIS (Internet information services on my windows XP machine. 
I've also installed php 5.0 from www.php.net. I'm trying to use the mail() 
function in a simple php script which uses a html form. However, i'm not 
able to send the mail using the mail($to, $subject, $message, $headers); 
function. I wonder what's wrong. Please help, i'm new to php.


Animesh Joshi 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mail function

2007-08-02 Thread Stut

Animesh Joshi wrote:

I've installed IIS (Internet information services on my windows XP machine. 
I've also installed php 5.0 from www.php.net. I'm trying to use the mail() 
function in a simple php script which uses a html form. However, i'm not able 
to send the mail using the mail($to, $subject, $message, $headers); function. I 
wonder what's wrong. Please help, i'm new to php.


Please review the Runtime Configuration section of 
http://uk.php.net/mail and make sure you've told php.ini about your mail 
server.


-Stut

--
http://stut.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mail function from and reply to address problem

2007-07-13 Thread Richard Lynch
On Thu, July 12, 2007 6:33 pm, Tanner Postert wrote:
 I am currently running

 PHP 5.1.4
 Fedora Core 5

 i'm trying to exectute the following test script.

 ?php
 $to  = '[EMAIL PROTECTED]';
 $subject = 'the subject';
 $message = 'body';
 $headers = 'From: [EMAIL PROTECTED]' . \r\n .
 'Reply-To: [EMAIL PROTECTED]' . \r\n .
 'X-Mailer: PHP/' . phpversion();

 mail($to, $subject, $message, $headers);
 ?

You really ought to be getting the return value from mail() and
checking it for success...

Error-checking is good. :-)

 i have about 10 or so different virtual hosts running on this machine,
 and
 if i use any of them for the from  reply-to addresses, it works fine,
 or
 even if i use domains I don't control like aol.com or example.com
 those work
 too, but one particular new virtual host doesn't work, it re-writes
 the from
 address to the default virtual host address. which is strange because
 that
 isn't in the php.ini anywhere, but it could just be taking the
 hostname.

 anyone have any ideas?

As I understand it:

If the PHP (read: Apache) User is not trusted in sendmail config,
then sendmail won't let that user forge the return headers, and the
return comes from the default set in sendmail configuration.

Substitute postfix or whatever as appropriate for your configuration.

So you now have the joy of digging into sendmail configuration.

Good luck!

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mail function from and reply to address problem

2007-07-13 Thread Chris

Richard Lynch wrote:

On Thu, July 12, 2007 6:33 pm, Tanner Postert wrote:

I am currently running

PHP 5.1.4
Fedora Core 5

i'm trying to exectute the following test script.

?php
$to  = '[EMAIL PROTECTED]';
$subject = 'the subject';
$message = 'body';
$headers = 'From: [EMAIL PROTECTED]' . \r\n .
'Reply-To: [EMAIL PROTECTED]' . \r\n .
'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
?


You really ought to be getting the return value from mail() and
checking it for success...

Error-checking is good. :-)


i have about 10 or so different virtual hosts running on this machine,
and
if i use any of them for the from  reply-to addresses, it works fine,
or
even if i use domains I don't control like aol.com or example.com
those work
too, but one particular new virtual host doesn't work, it re-writes
the from
address to the default virtual host address. which is strange because
that
isn't in the php.ini anywhere, but it could just be taking the
hostname.

anyone have any ideas?


As I understand it:

If the PHP (read: Apache) User is not trusted in sendmail config,
then sendmail won't let that user forge the return headers, and the
return comes from the default set in sendmail configuration.


Which is mentioned in the documentation:

http://www.php.net/manual/en/function.mail.php

;)

Sendmail and exim definitely have this sort of problem, I don't think 
postfix or qmail do though.


--
Postgresql  php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mail function from and reply to address problem

2007-07-13 Thread Tanner Postert

apache is definitely listed in the trusted users, as I mentioned, I can send
from dozens of other domains, its just one specific domain that I can't.
i'll let you know the results of sending the email from outside of php.

On 7/12/07, Chris [EMAIL PROTECTED] wrote:


Richard Lynch wrote:
 On Thu, July 12, 2007 6:33 pm, Tanner Postert wrote:
 I am currently running

 PHP 5.1.4
 Fedora Core 5

 i'm trying to exectute the following test script.

 ?php
 $to  = '[EMAIL PROTECTED]';
 $subject = 'the subject';
 $message = 'body';
 $headers = 'From: [EMAIL PROTECTED]' . \r\n .
 'Reply-To: [EMAIL PROTECTED]' . \r\n .
 'X-Mailer: PHP/' . phpversion();

 mail($to, $subject, $message, $headers);
 ?

 You really ought to be getting the return value from mail() and
 checking it for success...

 Error-checking is good. :-)

 i have about 10 or so different virtual hosts running on this machine,
 and
 if i use any of them for the from  reply-to addresses, it works fine,
 or
 even if i use domains I don't control like aol.com or example.com
 those work
 too, but one particular new virtual host doesn't work, it re-writes
 the from
 address to the default virtual host address. which is strange because
 that
 isn't in the php.ini anywhere, but it could just be taking the
 hostname.

 anyone have any ideas?

 As I understand it:

 If the PHP (read: Apache) User is not trusted in sendmail config,
 then sendmail won't let that user forge the return headers, and the
 return comes from the default set in sendmail configuration.

Which is mentioned in the documentation:

http://www.php.net/manual/en/function.mail.php

;)

Sendmail and exim definitely have this sort of problem, I don't think
postfix or qmail do though.

--
Postgresql  php tutorials
http://www.designmagick.com/



Re: [PHP] mail function from and reply to address problem

2007-07-13 Thread Tanner Postert

mail function returns 1(true) whether or not i'm sending to the new virtual
host domain name or any random domain name.

turns out sendmail function does the same thing, so it looks like it's a
sendmail problem... but how is that possible if i've never configured
anything for this new domain except for http virtual host config? hmm.

On 7/13/07, Tanner Postert [EMAIL PROTECTED] wrote:


apache is definitely listed in the trusted users, as I mentioned, I can
send from dozens of other domains, its just one specific domain that I
can't. i'll let you know the results of sending the email from outside of
php.

On 7/12/07, Chris [EMAIL PROTECTED] wrote:

 Richard Lynch wrote:
  On Thu, July 12, 2007 6:33 pm, Tanner Postert wrote:
  I am currently running
 
  PHP 5.1.4
  Fedora Core 5
 
  i'm trying to exectute the following test script.
 
  ?php
  $to  = '[EMAIL PROTECTED]';
  $subject = 'the subject';
  $message = 'body';
  $headers = 'From: [EMAIL PROTECTED]' . \r\n .
  'Reply-To: [EMAIL PROTECTED]' . \r\n .
  'X-Mailer: PHP/' . phpversion();
 
  mail($to, $subject, $message, $headers);
  ?
 
  You really ought to be getting the return value from mail() and
  checking it for success...
 
  Error-checking is good. :-)
 
  i have about 10 or so different virtual hosts running on this
 machine,
  and
  if i use any of them for the from  reply-to addresses, it works
 fine,
  or
  even if i use domains I don't control like aol.com or example.com
  those work
  too, but one particular new virtual host doesn't work, it re-writes
  the from
  address to the default virtual host address. which is strange because

  that
  isn't in the php.ini anywhere, but it could just be taking the
  hostname.
 
  anyone have any ideas?
 
  As I understand it:
 
  If the PHP (read: Apache) User is not trusted in sendmail config,
  then sendmail won't let that user forge the return headers, and the
  return comes from the default set in sendmail configuration.

 Which is mentioned in the documentation:

 http://www.php.net/manual/en/function.mail.php

 ;)

 Sendmail and exim definitely have this sort of problem, I don't think
 postfix or qmail do though.

 --
 Postgresql  php tutorials
 http://www.designmagick.com/





Re: [PHP] mail function from and reply to address problem

2007-07-13 Thread Tanner Postert

figured it out...

the domain in question's dns is set to CNAME to the main domain on that
server, whereas, the remaining domains are just using the A record with the
IP. I changed one of the other domains to use the CNAME and it did the same
thing. So looks like thats the culprit.

I'll have to comb through the sendmail configuration and find out if I can
reverse this behavior.

On 7/13/07, Tanner Postert [EMAIL PROTECTED] wrote:


mail function returns 1(true) whether or not i'm sending to the new
virtual host domain name or any random domain name.

turns out sendmail function does the same thing, so it looks like it's a
sendmail problem... but how is that possible if i've never configured
anything for this new domain except for http virtual host config? hmm.

On 7/13/07, Tanner Postert [EMAIL PROTECTED] wrote:

 apache is definitely listed in the trusted users, as I mentioned, I can
 send from dozens of other domains, its just one specific domain that I
 can't. i'll let you know the results of sending the email from outside of
 php.

 On 7/12/07, Chris  [EMAIL PROTECTED] wrote:
 
  Richard Lynch wrote:
   On Thu, July 12, 2007 6:33 pm, Tanner Postert wrote:
   I am currently running
  
   PHP 5.1.4
   Fedora Core 5
  
   i'm trying to exectute the following test script.
  
   ?php
   $to  = '[EMAIL PROTECTED]';
   $subject = 'the subject';
   $message = 'body';
   $headers = 'From: [EMAIL PROTECTED]' . \r\n .
   'Reply-To: [EMAIL PROTECTED]' . \r\n .
   'X-Mailer: PHP/' . phpversion();
  
   mail($to, $subject, $message, $headers);
   ?
  
   You really ought to be getting the return value from mail() and
   checking it for success...
  
   Error-checking is good. :-)
  
   i have about 10 or so different virtual hosts running on this
  machine,
   and
   if i use any of them for the from  reply-to addresses, it works
  fine,
   or
   even if i use domains I don't control like aol.com or example.com
   those work
   too, but one particular new virtual host doesn't work, it re-writes
   the from
   address to the default virtual host address. which is strange
  because
   that
   isn't in the php.ini anywhere, but it could just be taking the
   hostname.
  
   anyone have any ideas?
  
   As I understand it:
  
   If the PHP (read: Apache) User is not trusted in sendmail config,
   then sendmail won't let that user forge the return headers, and the
   return comes from the default set in sendmail configuration.
 
  Which is mentioned in the documentation:
 
  http://www.php.net/manual/en/function.mail.php
 
  ;)
 
  Sendmail and exim definitely have this sort of problem, I don't think
  postfix or qmail do though.
 
  --
  Postgresql  php tutorials
   http://www.designmagick.com/
 





Re: [PHP] mail function from and reply to address problem

2007-07-13 Thread Tijnema

On 7/13/07, Tanner Postert [EMAIL PROTECTED] wrote:

figured it out...

the domain in question's dns is set to CNAME to the main domain on that
server, whereas, the remaining domains are just using the A record with the
IP. I changed one of the other domains to use the CNAME and it did the same
thing. So looks like thats the culprit.

I'll have to comb through the sendmail configuration and find out if I can
reverse this behavior.


Sendmail has a usenet newsgroup (comp.mail.sendmail), where you might
be able to find someone that can help you :)

Tijnema


On 7/13/07, Tanner Postert [EMAIL PROTECTED] wrote:

 mail function returns 1(true) whether or not i'm sending to the new
 virtual host domain name or any random domain name.

 turns out sendmail function does the same thing, so it looks like it's a
 sendmail problem... but how is that possible if i've never configured
 anything for this new domain except for http virtual host config? hmm.

 On 7/13/07, Tanner Postert [EMAIL PROTECTED] wrote:
 
  apache is definitely listed in the trusted users, as I mentioned, I can
  send from dozens of other domains, its just one specific domain that I
  can't. i'll let you know the results of sending the email from outside of
  php.
 
  On 7/12/07, Chris  [EMAIL PROTECTED] wrote:
  
   Richard Lynch wrote:
On Thu, July 12, 2007 6:33 pm, Tanner Postert wrote:
I am currently running
   
PHP 5.1.4
Fedora Core 5
   
i'm trying to exectute the following test script.
   
?php
$to  = '[EMAIL PROTECTED]';
$subject = 'the subject';
$message = 'body';
$headers = 'From: [EMAIL PROTECTED]' . \r\n .
'Reply-To: [EMAIL PROTECTED]' . \r\n .
'X-Mailer: PHP/' . phpversion();
   
mail($to, $subject, $message, $headers);
?
   
You really ought to be getting the return value from mail() and
checking it for success...
   
Error-checking is good. :-)
   
i have about 10 or so different virtual hosts running on this
   machine,
and
if i use any of them for the from  reply-to addresses, it works
   fine,
or
even if i use domains I don't control like aol.com or example.com
those work
too, but one particular new virtual host doesn't work, it re-writes
the from
address to the default virtual host address. which is strange
   because
that
isn't in the php.ini anywhere, but it could just be taking the
hostname.
   
anyone have any ideas?
   
As I understand it:
   
If the PHP (read: Apache) User is not trusted in sendmail config,
then sendmail won't let that user forge the return headers, and the
return comes from the default set in sendmail configuration.
  
   Which is mentioned in the documentation:
  
   http://www.php.net/manual/en/function.mail.php
  
   ;)
  
   Sendmail and exim definitely have this sort of problem, I don't think
   postfix or qmail do though.
  
   --
   Postgresql  php tutorials
http://www.designmagick.com/
  
 
 





--
Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mail function from and reply to address problem

2007-07-13 Thread Tanner Postert

thanks, thats exactly where I went. looks like i'm on the right track.

On 7/13/07, Tijnema [EMAIL PROTECTED] wrote:


On 7/13/07, Tanner Postert [EMAIL PROTECTED] wrote:
 figured it out...

 the domain in question's dns is set to CNAME to the main domain on that
 server, whereas, the remaining domains are just using the A record with
the
 IP. I changed one of the other domains to use the CNAME and it did the
same
 thing. So looks like thats the culprit.

 I'll have to comb through the sendmail configuration and find out if I
can
 reverse this behavior.

Sendmail has a usenet newsgroup (comp.mail.sendmail), where you might
be able to find someone that can help you :)

Tijnema

 On 7/13/07, Tanner Postert [EMAIL PROTECTED] wrote:
 
  mail function returns 1(true) whether or not i'm sending to the new
  virtual host domain name or any random domain name.
 
  turns out sendmail function does the same thing, so it looks like it's
a
  sendmail problem... but how is that possible if i've never configured
  anything for this new domain except for http virtual host config? hmm.
 
  On 7/13/07, Tanner Postert [EMAIL PROTECTED] wrote:
  
   apache is definitely listed in the trusted users, as I mentioned, I
can
   send from dozens of other domains, its just one specific domain that
I
   can't. i'll let you know the results of sending the email from
outside of
   php.
  
   On 7/12/07, Chris  [EMAIL PROTECTED] wrote:
   
Richard Lynch wrote:
 On Thu, July 12, 2007 6:33 pm, Tanner Postert wrote:
 I am currently running

 PHP 5.1.4
 Fedora Core 5

 i'm trying to exectute the following test script.

 ?php
 $to  = '[EMAIL PROTECTED]';
 $subject = 'the subject';
 $message = 'body';
 $headers = 'From: [EMAIL PROTECTED]' . \r\n .
 'Reply-To: [EMAIL PROTECTED]' . \r\n .
 'X-Mailer: PHP/' . phpversion();

 mail($to, $subject, $message, $headers);
 ?

 You really ought to be getting the return value from mail() and
 checking it for success...

 Error-checking is good. :-)

 i have about 10 or so different virtual hosts running on this
machine,
 and
 if i use any of them for the from  reply-to addresses, it
works
fine,
 or
 even if i use domains I don't control like aol.com or
example.com
 those work
 too, but one particular new virtual host doesn't work, it
re-writes
 the from
 address to the default virtual host address. which is strange
because
 that
 isn't in the php.ini anywhere, but it could just be taking the
 hostname.

 anyone have any ideas?

 As I understand it:

 If the PHP (read: Apache) User is not trusted in sendmail
config,
 then sendmail won't let that user forge the return headers, and
the
 return comes from the default set in sendmail configuration.
   
Which is mentioned in the documentation:
   
http://www.php.net/manual/en/function.mail.php
   
;)
   
Sendmail and exim definitely have this sort of problem, I don't
think
postfix or qmail do though.
   
--
Postgresql  php tutorials
 http://www.designmagick.com/
   
  
  
 



--
Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info



RE: [PHP] mail function from and reply to address problem

2007-07-12 Thread Steve Perkins
Sounds more like the mail server than PHP. Although weird anyway ! What mail
server are you using : local/remote, smtp/sendmail/qmail ? 

Try using whatever method and send a mail through this server from outside
of PHP with the same problem parameters ? Does that work ? It should either
eliminate PHP, or point the finger ! I suspect eliminate but you never
know..

That's where I think I'd start anyway. Send uz an update when you have some
answers.

Steve


-Original Message-
From: Tanner Postert [mailto:[EMAIL PROTECTED] 
Sent: 13 July 2007 00:33
To: php-general@lists.php.net
Subject: [PHP] mail function from and reply to address problem

I am currently running

PHP 5.1.4
Fedora Core 5

i'm trying to exectute the following test script.

?php
$to  = '[EMAIL PROTECTED]';
$subject = 'the subject';
$message = 'body';
$headers = 'From: [EMAIL PROTECTED]' . \r\n .
'Reply-To: [EMAIL PROTECTED]' . \r\n .
'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers); ?

i have about 10 or so different virtual hosts running on this machine, and
if i use any of them for the from  reply-to addresses, it works fine, or
even if i use domains I don't control like aol.com or example.com those work
too, but one particular new virtual host doesn't work, it re-writes the from
address to the default virtual host address. which is strange because that
isn't in the php.ini anywhere, but it could just be taking the hostname.

anyone have any ideas?

thanks in advance.

Tanner

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mail function problem

2007-07-05 Thread Daniel Brown

On 7/5/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

Chris a écrit :
 web2 wrote:
 Chris a écrit :

 Try this:
 ?
 $email = [EMAIL PROTECTED];
 $headers  = From: .$email.\r\n;
 $headers .= X-Mailer: PHP/.phpversion().\r\n;
 if(mail([EMAIL PROTECTED],essai,test,$headers)) {
echo OK: .ini_get('sendmail_path');
 } else {
echo NOK: .ini_get('sendmail_path');
 }
 ?

Note

 Same result : NOK /usr/lib/sendmail -t -i
 I think the problem is not in the test script.



 Is that the right path? Normally it's /usr/sbin/sendmail not /usr/lib .

 Yes, /usr/sbin/sendmail is a link to /usr/lib/sendmail.

 I've made tests and with the php binary (php -f myscript.php), the
 mail is send.
 It only doesn't work with the apache module (libphp5.so)...

 So, it confirms that the script and the PHP configuration (php.ini)
 are OK.

 Are you running SeLinux by any chance? Check your /var/log/messages
 and/or /var/log/syslog to see if they provide any answers.

I'm not running SeLinux, I'm using Solaris 10 (AMD64), and I've checked
syslog and messages but there's nothing...

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




   Is your script being run via the CLI or the web?

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mail function problem

2007-07-05 Thread web2

Chris a écrit :

web2 wrote:

Chris a écrit :



Try this:
?
$email = [EMAIL PROTECTED];
$headers  = From: .$email.\r\n;
$headers .= X-Mailer: PHP/.phpversion().\r\n;
if(mail([EMAIL PROTECTED],essai,test,$headers)) {
   echo OK: .ini_get('sendmail_path');
} else {
   echo NOK: .ini_get('sendmail_path');
}
?

   Note


Same result : NOK /usr/lib/sendmail -t -i
I think the problem is not in the test script.




Is that the right path? Normally it's /usr/sbin/sendmail not /usr/lib .


Yes, /usr/sbin/sendmail is a link to /usr/lib/sendmail.

I've made tests and with the php binary (php -f myscript.php), the 
mail is send.

It only doesn't work with the apache module (libphp5.so)...

So, it confirms that the script and the PHP configuration (php.ini) 
are OK.


Are you running SeLinux by any chance? Check your /var/log/messages 
and/or /var/log/syslog to see if they provide any answers.


I'm not running SeLinux, I'm using Solaris 10 (AMD64), and I've checked 
syslog and messages but there's nothing...


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mail function problem

2007-07-05 Thread Tijnema

On 7/5/07, Daniel Brown [EMAIL PROTECTED] wrote:

On 7/5/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Chris a écrit :
  web2 wrote:
  Chris a écrit :
 
  Try this:
  ?
  $email = [EMAIL PROTECTED];
  $headers  = From: .$email.\r\n;
  $headers .= X-Mailer: PHP/.phpversion().\r\n;
  if(mail([EMAIL PROTECTED],essai,test,$headers)) {
 echo OK: .ini_get('sendmail_path');
  } else {
 echo NOK: .ini_get('sendmail_path');
  }
  ?
 
 Note
 
  Same result : NOK /usr/lib/sendmail -t -i
  I think the problem is not in the test script.
 
 
 
  Is that the right path? Normally it's /usr/sbin/sendmail not /usr/lib .
 
  Yes, /usr/sbin/sendmail is a link to /usr/lib/sendmail.
 
  I've made tests and with the php binary (php -f myscript.php), the
  mail is send.
  It only doesn't work with the apache module (libphp5.so)...
 
  So, it confirms that the script and the PHP configuration (php.ini)
  are OK.
 
  Are you running SeLinux by any chance? Check your /var/log/messages
  and/or /var/log/syslog to see if they provide any answers.
 
 I'm not running SeLinux, I'm using Solaris 10 (AMD64), and I've checked
 syslog and messages but there's nothing...

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



   Is your script being run via the CLI or the web?

--
Daniel P. Brown


he's running it on the web, as the CLI worked ;)

Did you try to su to the PHP user first and then try to send the mail
with the CLI?
Sounds like a permission issue...

Tijnema

--
Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



  1   2   3   >