2

I have the following code:

$config = array(
   'auth' => 'login',
   'username' => 'domain\user',
   'password' => 'password',
   'ssl' => 'tls',
   'port' => 25,
);

$tr = new Zend_Mail_Transport_Smtp('192.168.101.11',$config);
Zend_Mail::setDefaultTransport($tr);

$mail = new Zend_Mail();
$mail->setBodyText($text);
$mail->setFrom('noreply@domain.com');
$mail->addTo($user->getEmail());
$mail->setSubject('Email subject');
$mail->send();

When I try to connect using what should be the correct credentials I get the following error in the log:

2010-10-12T13:00:59-07:00 ERR (3): AdminController::emailPassword - 5.7.1
2010-10-12T13:00:59-07:00 ERR (3): AdminController::emailPassword - #0 /usr/share/php/Zend/Mail/Protocol/Smtp.php(261): Zend_Mail_Protocol_Abstract->_expect(250, 300)
        #1 /usr/share/php/Zend/Mail/Transport/Smtp.php(207): Zend_Mail_Protocol_Smtp->mail('noreply@domain...')
        #2 /usr/share/php/Zend/Mail/Transport/Abstract.php(348): Zend_Mail_Transport_Smtp->_sendMail()
        #3 /usr/share/php/Zend/Mail.php(1178): Zend_Mail_Transport_Abstract->send(Object(Zend_Mail))
...

When I try to connect and send an email using a definitely bad password I get the following error:

2010-10-12T13:03:52-07:00 ERR (3): AdminController::emailPassword - 5.7.3
2010-10-12T13:03:52-07:00 ERR (3): AdminController::emailPassword - #0 /usr/share/php/Zend/Mail/Protocol/Smtp/Auth/Login.php(95): Zend_Mail_Protocol_Abstract->_expect(235)
#1 /usr/share/php/Zend/Mail/Protocol/Smtp.php(217): Zend_Mail_Protocol_Smtp_Auth_Login->auth()
#2 /usr/share/php/Zend/Mail/Transport/Smtp.php(200): Zend_Mail_Protocol_Smtp->helo('localhost')
#3 /usr/share/php/Zend/Mail/Transport/Abstract.php(348): Zend_Mail_Transport_Smtp->_sendMail()
#4 /usr/share/php/Zend/Mail.php(1178): Zend_Mail_Transport_Abstract->send(Object(Zend_Mail))
#5 /var/www/mreserve/application/controllers/AdminController.php(458): Zend_Mail->send()
...

My problem, I don't really know how to diagnose these errors. Where do I look up what 5.7.1 and 5.7.3 error codes are described, etc? Google wasn't helping me too much. When I plug in the credentials for my personal GMail account I am able to send mail just fine, so I know that I can send emails when configured correctly.

A few other possibly helpful tidbits, I am trying to send from a company Exchange that has created an email account for this user, I am trying to send to an email outside of the domain, and I don't have a lot of access to the exchange server- other than a few screenshots on how they set up their email clients.

4

1 回答 1

3

这些是 Exchange 服务器的 NDR(未送达报告)代码。 这是一个描述它们的(相当旧的)博客条目另一个页面列出了Exchange 2007 的相同代码。

5.7.1 错误代码

“权限问题”,可能指向:

  • SMTP中继问题。您的帐户无权向其他域发送电子邮件。
  • 发件人/收件人问题。您的帐户无权向讨论列表发送电子邮件(因为您的帐户不是其中的成员)
  • 对您的帐户的其他特定限制。

恕我直言,只有 SMTP 日志才能说出确切的原因。

5.7.3 错误代码

“发件人被禁止”或“未授权,安全问题”,取决于来源;可能与错误的密码提交一致。

希望这可以帮助。

于 2010-10-12T20:57:08.813 回答