535 Error: authentication failedITeye - 牛牛娱乐

535 Error: authentication failedITeye

2019-01-11 22:10:16 | 作者: 雪卉 | 标签: 邮件,测验,方法 | 浏览: 396

javax.mail.AuthenticationFailedException: 535 Error: authentication failed 1、测验代码:rn[code=java]rnimport java.io.IOException;rnrnimport javax.mail.MessagingException;rnimport javax.mail.Session;rnrnimport org.junit.Test;rnrnimport cn.itcast.mail.Mail;rnimport cn.itcast.mail.MailUtils;rnrn/**rn * 测验MailUtils,作用是发邮件rn * 底层依靠的是javamail:mail.jar、activation.jarrn * @author miaoxingrenrn *rn */rnpublic class MailUtilsTest rn /**rn * 发邮件rn * @throws IOException rn * @throws MessagingException rn */rn @Testrn public void sent() throws MessagingException, IOExceptionrn /*rn * 1.登录邮件服务器rn * MailUtils.createSession(服务器地址,登录名,暗码);rn * 2.创立邮件目标rn * 发件人rn * 收件人rn * 主题rn * 正文rn * 3.发rn * 需求第一步得到session、和第二步的邮件目标rn */rn Session session = MailUtils.createSession( smtp.163.com , xxx , xxx rn rn Mail mail = new Mail( xxx1@163.com , xxx2@163.com , 测验邮件一封 , 百度 rn rn MailUtils.send(session, mail);rn rnrn[/code]rn2、运用的jar包状况:[img=/uploads/allimg/190111/20190111221016kdatzjxd4vx34889.png][/img]rnrn3、呈现的反常信息:rnjavax.mail.AuthenticationFailedException: 535 Error: authentication failedrnrn at com.sun.mail.smtp.SMTPTransport$Authenticator.authenticate(SMTPTransport.java:648)rn at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:583)rn at javax.mail.Service.connect(Service.java:313)rn at javax.mail.Service.connect(Service.java:172)rn at javax.mail.Service.connect(Service.java:121)rn at javax.mail.Transport.send0(Transport.java:190)rn at javax.mail.Transport.send(Transport.java:120)rn at cn.itcast.mail.MailUtils.send(MailUtils.java:91)rn at MailUtilsTest.sent(MailUtilsTest.java:42)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:601)rn at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)rn at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)rn at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)rn at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)rn at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)rn at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)rn at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)rn at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)rn at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)rn at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)rn at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)rn at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)rn at org.junit.runners.ParentRunner.run(ParentRunner.java:236)rn at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)rn at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)rnrn4、注:①邮箱的账号暗码都正确,而且敞开了SMTP协议rn ②试过底层删去mail和activation文件夹,方法无效rn ③现在运用的是另一种处理方法:将Java EE 5 Library 改为6的 上述呈现的反常便是这种方法的rnrn查了好久,仍是没处理,期望哪位大神帮助看看,帮我这个菜鸟处理下,好人终身安全,谢谢!rnrnrnrnrnrnrn

版权声明
本文来源于网络,版权归原作者所有,其内容与观点不代表牛牛娱乐立场。转载文章仅为传播更有价值的信息,如采编人员采编有误或者版权原因,请与我们联系,我们核实后立即修改或删除。

猜您喜欢的文章

阅读排行

  • 1
  • 2

    第02章 根底中心ITeye

    目标,根底,中心
  • 3
  • 4
  • 5

    Java中字符串的使用ITeye

    字符串,字符,比较
  • 6
  • 7

    UTLITeye

    数据,目录,文件
  • 8
  • 9
  • 10

    java与函数式编程ITeye

    函数,编程,一些