谢谢你的关注!
是这样的...代码相同,用[email protected]就能发出邮件,我改用[email protected]和我的QQ信箱就发不出去,主要报错是:AuthenticatorException,就是不认证.或都是550.send faile..
我也用了Authenticator类来认证,也没有用.结果一样...想不通???
楼上的,谢谢你,可以话可以给我发邮件[email protected]

解决方案 »

  1.   

    我只做一个普通的发邮件(不含附件)的方法,但我用[email protected]能发出去.
    而我用[email protected]却发不出去,用QQ信箱也相同..都是报这个错误:
    Error:535 Error: authentication failed
    javax.mail.AuthenticationFailedException.
    代码:
     trans.connect(smtpHost, username,password);//, HUAWEI_MAIL_PASSWORD); 
     trans.sendMessage(mess,mess.getAllRecipients()); 
    出错显示,不是在第一条,就是在第二条..
         我在查资料的过程中,有很多的示例,有对此评论成功的,有对此评论失败的.
    但我在测试时,大多失败!有用[email protected]成功,但用[email protected]却从来没有成功(包括有MailAuthenticator extends Authenticator认证也没有用).
         我想请各位成功做过这方面的前辈,大侠指教.谢谢!
      

  2.   

    我用smtp.163.com老是出javax.mail.AuthenticationFailedException.
    自己用transport.isConnect()判断连接上了,就是发生这个异常,我也重写了认证类了,代码如下:Session session = Session.getDefaultInstance(props,new Authenticator() {
        
         protected PasswordAuthentication getPasswordAuthentication() {
              PasswordAuthentication pa = new PasswordAuthentication("lean1252", "lean433957");
              if(pa == null) {
               System.out.println("auth failed...");
              }
              return pa;
         }   
         });
    可它为什么问题提示认证失败了呢?
    把smtp.gmail.com就能发送,不知道是什么原因
      

  3.   

    PasswordAuthentication pa = new PasswordAuthentication
    好象不需要,对163.com和gmail.com,QQ吗,你要在QQ信箱设置SMTP才可以
    [email protected]这个吗,你先用你自己的密码在WEB上登陆可能上去不?
      

  4.   

    出现同类错误
    at frame.LoginFrame$1.run(LoginFrame.java:136)
    javax.mail.AuthenticationFailedException: 535 Error: authentication failed at com.sun.mail.smtp.SMTPTransport$Authenticator.authenticate(SMTPTransport.java:823)
    at com.sun.mail.smtp.SMTPTransport.authenticate(SMTPTransport.java:756)
    at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:673)
    at javax.mail.Service.connect(Service.java:317)
    at javax.mail.Service.connect(Service.java:176)
    at mailutil.SendAttachMail.connect(SendAttachMail.java:189)
    at action.LoginAction.isLogin(LoginAction.java:42)
    at frame.LoginFrame.checkUser(LoginFrame.java:167)
    at frame.LoginFrame.access$0(LoginFrame.java:165)
    at frame.LoginFrame$1.run(LoginFrame.java:136)