DATE package not authenticating
| From: | Eric Rawlins | Date: | Fri, 21 Jan 2005 01:02:37 +0000 |
| Subject: | DATE package not authenticating | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-17063@lists.php.net to get a copy of this message | ||
I am trying to use the PEAR DATE package to send an email using SMTP via Earthlink, which provides my DSL connection. This is my first attempt to use PEAR, so I may be missing something elementary. I know I'm getting as far as communicating with Earthlink because my little net monitor program tells me so. I checked with Earthlink, and they confirm that the authentication parameters I'm using are correct and should work.
The documentation for the "unable to authenticate" message in PEAR says, "Ensure to use the correct authentication method for the SMTP server", but I can't find any other reference to "method" in the doc and don't know what that might be referring to.
Here's the code I'm running (pretty much copied from the sample in the PEAR doc) and the results I'm getting. Anybody see anything obvious?
Environment:
Mac OS 10.3.7
PHP 4.3.9
Connection to Earthlink via DSL
Executed code:
<?php
include 'Mail.php';
PEAR::setErrorHandling(PEAR_ERROR_DIE);
$recipients = 'woodman@well.com';
$headers['From'] = 'woodman@well.com';
$headers['To'] = 'woodman@well.com';
$headers['Subject'] = 'Test message';
$body = 'Test message';
$params['host'] = 'smtpauth.earthlink.net';
$params['port'] = 25;
$params['auth'] = 'TRUE';
$params['username'] = 'woodzie@earthlink.net';
$params['password'] = '[my password]';
// Create the mail object using the Mail::factory method
$mail_object =& Mail::factory('smtp', $params);
echo 'Factory result:<p>';
print_r(get_object_vars($mail_object));
// Send the mail and display the results
echo '<p>Send result:<p>';
print_r(get_object_vars($mail_object->send($recipients, $headers, $body)));
?>
Factory result:
Array ( [sep] =>
[host] => smtpauth.earthlink.net [port] => 25 [auth] => TRUE [username] => woodzie@earthlink.net [password] => [my password]
[localhost] => localhost )
Send result:
Array ( [error_message_prefix] =>
[mode] => 1 [level] => 1024 [code] =>
[message] => unable to authenticate to smtp server
[userinfo] =>
[backtrace] => Array (
[0] => Array ( [file] => /usr/local/php/lib/php/Mail/smtp.php [line] => 145 [function] => pear_error [class] => pear_error [type] => -> [args] => Array ( [0] => unable to authenticate to smtp server ) ) [1] => Array ( [file] => /Users/ericrawlins/Sites/calendar/pearmail.php [line] => 12 [function] => send [class] => mail_smtp [type] => -> [args] => Array ( [0] => woodman@well.com [1] => Array ( [From] => woodman@well.com [To] => woodman@well.com [Subject] => Test message ) [2] => Test message ) ) ) [callback] => )