Bug #3301 [NEW]: Mail can not be sent from CLI

From: Date: Wed, 26 Jan 2005 15:46:16 +0000
Subject: Bug #3301 [NEW]: Mail can not be sent from CLI
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-5474@lists.php.net to get a copy of this message
From: tchoudinov at yahoo dot com Operating system: Windows2000 server SP4 PHP version: 4.3.9 Package: Documentation Bug Type: Bug Bug description: Mail can not be sent from CLI Description: ------------ When using Mail_SMTP in command line environment class does not send mails at all. Send() function reports "unable to authenticate to smtp server" And a couple of notices: Notice: Array to string conversion in C:\php\pear\Net\SMTP.php on line 365 Notice: Array to string conversion in C:\php\pear\Net\SMTP.php on line 363 The same script in WEB environment (either Apache or IIS) works just fine. Reproduce code: --------------- $recipients = 'tchoudinov@yahoo.com'; $headers['From'] = 'mikhail@adstate.com'; $headers['To'] = 'tchoudinov@yahoo.com'; $headers['Subject'] = 'Test message YY'; $body = 'Test message BB'; //fill an array with parameters $params["host"] = MAIL_SMTP_HOST; //The server to connect. $params["port"] = MAIL_SMTP_PORT; //The port to connect. $params["auth"] = MAIL_SMTP_AUTH; //Whether or not to use SMTP authentication. $params["username"] = MAIL_SMTP_USERNAME; //The username to use for SMTP authentication. $params["password"] = MAIL_SMTP_PASSWORD; //The password to use for SMTP authenticat // Create the mail object using the Mail::factory method $mail_object =& Mail::factory('smtp', $params); $Result = $mail_object->send($recipients, $headers, $body); echo($Result->getMessage()); Expected result: ---------------- We run the script from command line, but mail must be sent. Actual result: -------------- Script repotrs about errors to command line: Notice: Array to string conversion in C:\php\pear\Net\SMTP.php on line 363 Notice: Array to string conversion in C:\php\pear\Net\SMTP.php on line 365 unable to authenticate to smtp server -- Edit bug report at http://pear.php.net/bugs/bug.php?id=3301&edit=1 --

« previous php.pear.doc (#5474) next »