您好,欢迎来到[编程问答]网站首页   源码下载   电子书籍   软件下载   专题
当前位置:首页 >> 编程问答 >> Java >> javamail class javaxmailAuthenticationFailedException

javamail class javaxmailAuthenticationFailedException

来源:网络整理     时间:2016/7/19 12:56:42     关键词:

关于网友提出的“ javamail class javaxmailAuthenticationFailedException”问题疑问,本网通过在网上对“ javamail class javaxmailAuthenticationFailedException”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:

问题: javamail class javaxmailAuthenticationFailedException
描述:

JAMES SMTP Server 2.3.2
config.xml加了:
announce
错误信息
DEBUG: setDebug: JavaMail version 1.3
DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
DEBUG SMTP: useEhlo true, useAuth true
DEBUG: SMTPTransport trying to connect to host "10.237.89.20", port 25
DEBUG SMTP RCVD: 220 ebtqa.com SMTP Server (JAMES SMTP Server 2.3.2) ready Fri, 28 Dec 2012 08:25:53 -0600 (CST)
DEBUG: SMTPTransport connected to host "10.237.89.20", port: 25
DEBUG SMTP SENT: EHLO psc-SteveSun-01
DEBUG SMTP RCVD: 250-ebtqa.com Hello psc-SteveSun-01 (10.237.88.104 [10.237.88.104])
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250-PIPELINING
250 ENHANCEDSTATUSCODES
DEBUG SMTP Found extension "AUTH", arg "LOGIN PLAIN"
DEBUG SMTP Found extension "AUTH=LOGIN", arg "PLAIN"
DEBUG SMTP Found extension "PIPELINING", arg ""
DEBUG SMTP Found extension "ENHANCEDSTATUSCODES", arg ""
DEBUG SMTP: Attempt to authenticate
DEBUG SMTP SENT: AUTH LOGIN
DEBUG SMTP RCVD: 334 VXNlcm5hbWU6
DEBUG SMTP SENT: bXN1bg==
DEBUG SMTP RCVD: 334 UGFzc3dvcmQ6
DEBUG SMTP SENT: bXN1bg==
DEBUG SMTP RCVD: 235 Authentication Successful
Sending failed;
  nested exception is:
class javax.mail.AuthenticationFailedException
安全认证的代码:


          authenticator = new MyAuthenticator(getHostUser(), getHostPassword());   
          _session = Session.getInstance(prop, new Authenticator() {
              protected javax.mail.PasswordAuthentication getPasswordAuthentication() {
                  return new javax.mail.PasswordAuthentication(getHostUser(),
                   getHostPassword());
                  }
              });

如何解决?谢谢

解决方案1:

DEBUG SMTP RCVD: 235 Authentication Successful
这里你权限验证以及成功了。
然后说:
Sending failed;
  nested exception is:
class javax.mail.AuthenticationFailedException
你看下你的代码中是否用了Transport.send(msg)这样的方法
换成下面的试试:
Transport transport=session.getTransport();
transport.send(msg,new Address[]{new InternetAddress("xxx@sina.com")});

解决方案2:

已经提醒你了,认证失败!
请确认认证信息!


以上介绍了“ javamail class javaxmailAuthenticationFailedException”的问题解答,希望对有需要的网友有所帮助。
本文网址链接:http://www.codes51.com/itwd/2804746.html

相关图片

相关文章