PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Why SMTP Authentication failure?(soluted)

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> Mail
View previous topic :: View next topic  
Author Message
tallhandsome



Joined: 09 May 2009
Posts: 2
Location: China

PostPosted: Sat May 09, 2009 1:32 pm    Post subject: Why SMTP Authentication failure?(soluted) Reply with quote

My mail server is hmailserver for windows, and I use the PHP script below to send a mail but failed.The error info is "Failed to add recipient: [email protected] [SMTP: Invalid response code received from server (code: 530, response: SMTP authentication is required.)]". And when I cancle the authentic require of hmailserver it works well.
Code:
$params=array();
   $params['host']    = $conf['smtp_server'];
   $params['username'] = '[email protected]';
   $params['password'] = 'joe';
   $params["auth"] = false;
   $mailer = Mail::factory('smtp',$params);
   $mailer->send('[email protected]',$mime_headers,$body);


Is it a bug of the Mail class?
I saw the similar problem in http://www.pear-forum.org/topic2255.html

oxtail said that:
I fixed this in the PEAR code in my machine. In Net/SMTP.php, see this method:

function auth($uid, $pwd , $method = '')

the first line is:
Code:
if (version_compare(PHP_VERSION, '5.1.0', '>=') && isset($this->_esmtp['STARTTLS'])) {


change it to
Code:
if (version_compare(PHP_VERSION, '5.1.0', '>=') && ($this->_esmtp['STARTTLS'] == true)) {

But it doesn't work in my machine. Who can help me? Thanks first.


Embarassed Oh ,It's all my fault.When smtp authentication required,$params["auth"] should be true.

The PEAR is perfect!! Keep this topic for others Smile
_________________
iamtallandiamhandsomehaha
Back to top
View user's profile Send private message
jkoerber



Joined: 27 Dec 2009
Posts: 5

PostPosted: Mon Dec 28, 2009 11:16 pm    Post subject: Reply with quote

See my posting at http://www.pear-forum.org/topic2367.html, it may give you another option for getting Mail with SMTP authentication to work for you without having to fiddle with changing the PEAR source code.

NOTE: I think the Auth_SASL is no longer being supported, but seems to work just fine for me.

-- Jon
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> Mail All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement