Re: PEAR Mail Authentication Problems
| From: | Charles Kline | Date: | Fri, 03 Oct 2003 01:41:00 +0000 |
| Subject: | Re: PEAR Mail Authentication Problems | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-8246@lists.php.net to get a copy of this message | ||
Well... okay. I have tested this now on 2 other mail servers and they work fine. The mail server I am running into trouble on is Communigate Pro from Stalker.
Here is the connection info from the log file:
13:51:14.98 5 SMTP connection request from [63.150.17.100:54585], socket=30
13:51:14.98 4 SMTPI-61053([63.150.17.100]) got connection on [63.150.17.99:25]
13:51:14.98 5 SMTPI-61053([63.150.17.100]) out: 220 mcp.ydim.com ESMTP CommuniGate Pro 4.1 is glad to see you!\r\n
13:51:14.99 5 SMTPI-61053([63.150.17.100]) inp: EHLO rightcode.net
13:51:14.99 5 SMTPI-61053([63.150.17.100]) out: 250-mcp.ydim.com your name is not rightcode.net\r\n250-HELP\r\n250-PIPELINING\r\n250-ETRN\r\n250-DSN\r\n250-TURN\r\n250-ATRN\r\n250-SIZE 31457280\r\n250
13:51:14.99 3 SMTPI-61053([63.150.17.100]) read failed. Error Code=connection closed by peer
13:51:14.99 4 SMTPI-61053([63.150.17.100]) closing connection
13:51:14.99 4 SMTPI-61053([63.150.17.100]) releasing stream
Does that help anyone help me??
Thanks,
Charles
On Thursday, Oct 2, 2003, at 11:28 US/Eastern, Charles Kline wrote:
Hello,
I have tracked my troubles with using the PEAR Mail class to smtp authentication failing.
Here is what I have:
<?php
require 'Mail.php';
$to = 'ckline@mymailserver.net';
$headers['From'] = 'website@mymailserver.net';
$headers['Subject'] = 'Testing';
$body = 'hey it worked';
$params['host'] = "smtp.mymailserver.net";
$params['auth'] = "TRUE";
$params['username'] = "ckline"; // have also tried ckline@smtp.mymailserver.net
$params['password'] = "mypassword";
$message =& Mail::factory('smtp', $params);
$result = $message->send($to, $headers, $body);
echo "<pre>";
var_dump($result);
echo "</pre>";
?>
The results of the var_dump() are this:
object(pear_error)(8) {
["error_message_prefix"]=>
string(0) ""
["mode"]=>
int(1)
["level"]=>
int(1024)
["code"]=>
NULL
["message"]=>
string(37) "unable to authenticate to smtp server"
["userinfo"]=>
NULL
["backtrace"]=>
array(2) {
[0]=>
array(6) {
["file"]=>
string(32) "/usr/local/lib/php/Mail/smtp.php"
["line"]=>
int(147)
["function"]=>
string(10) "pear_error"
["class"]=>
string(10) "pear_error"
["type"]=>
string(2) "->"
["args"]=>
array(1) {
[0]=>
string(37) "unable to authenticate to smtp server"
}
}
[1]=>
array(6) {
["file"]=>
string(69) "/contact/send.php"
["line"]=>
int(13)
["function"]=>
string(4) "send"
["class"]=>
string(9) "mail_smtp"
["type"]=>
string(2) "->"
["args"]=>
array(3) {
[0]=>
string(25) "ckline@smtp.mymailserver.net"
[1]=>
array(2) {
["From"]=>
string(26) "website@smtp.mymailserver.net"
["Subject"]=>
string(7) "Testing"
}
[2]=>
string(13) "hey it worked"
}
}
}
["callback"]=>
NULL
}
--PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php