发生 javax.mail.AuthenticationFailedException 并返回 null

阳离子

我只是让一个邮件类参考这个

javax.mail.AuthenticationFailedException发生返回空值。

11-26 22:51:25.053 19008-20169/com.example.android.mailGenerater E/AndroidRuntime:致命异常:线程 7 进程:com.example.android.mailGenerater,PID:19008 javax.mail.AuthenticationFailedException at javax. mail.Service.connect(Service.java:319) at javax.mail.Service.connect(Service.java:169) at javax.mail.Service.connect(Service.java:118) at javax.mail.Transport.send0 (Transport.java:188) at javax.mail.Transport.send(Transport.java:118) at com.example.android.mailGenerater.SendGmailManager(SendGmailManager.kt:145) at com.example.android.mailGenerater.MyActivity$ onCreate$1$1.run(MyActivity.kt:60)

我用exception它的代码

 catch (e: AuthenticationFailedException) {
        Log.d(TAG, "auth failed : ${e.localizedMessage}") // print : "auth failed : null"
        e.printStackTrace() // not working.

它什么都不显示。

该异常返回null,因此打印堆栈跟踪不起作用。


我想知道AuthenticationFailedException 何时发生且为 null

阳离子

对不起

这个问题依赖于我所有的错误。

我想念以下儿童班的代码 javax.mail.Authenticator

protected PasswordAuthentication getPasswordAuthentication() {   
    return new PasswordAuthentication(user, password);   
} 

我想Null occurred如果没有override method : getPasswordAuthentication()

当我添加覆盖方法时,它工作得很好。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

解决错误javax.mail.AuthenticationFailedException

来自分类Dev

javax.mail.AuthenticationFailedException:如何无法通过Java发送邮件?

来自分类Dev

JavaMail异常javax.mail.AuthenticationFailedException 534-5.7.9需要特定于应用程序的密码

来自分类Dev

找到javax.mail.AuthenticationFailedException:连接失败,未指定密码?在收听密码正确的新邮件时

来自分类Dev

错误:发生了JNI错误(javax.mail.jar)

来自分类Dev

javax.mail.SendFailedException

来自分类Dev

寻找JAVAX.Mail Jar

来自分类Dev

域未处理的异常发生后,MemoryCache总是返回null

来自分类Dev

如果发生故障,LoadLibrary是否返回NULL或错误代码<32?

来自分类Dev

Slick2D getGraphics()返回null,发生空指针异常

来自分类Dev

sending email with ssl using javax.mail

来自分类Dev

javax mail getReceivedDate在发送者的时区

来自分类Dev

是javax / mail / async中'Transport'的方法'send'

来自分类Dev

javax.mail.Session的用途是什么?

来自分类Dev

Maven忽略了javax.mail的提供范围

来自分类Dev

javax mail getReceivedDate在发送者的时区

来自分类Dev

是javax / mail / async中'Transport'的方法'send'

来自分类Dev

Wildfly 10.1.0 ClassNotFoundException:javax.mail.Authenticator

来自分类Dev

javax.mail.Part.getContent() ArrayIndexOutOfBoundsException: 16448

来自分类Dev

javax.mail:不选择属性

来自分类Dev

返回new []时发生NullPointerException

来自分类Dev

Maven Jetty插件:javax.mail.Session无法转换为javax.mail.Session

来自分类Dev

null == null返回false?

来自分类Dev

null == null返回false?

来自分类Dev

搜索javax邮件并返回找到的单词

来自分类Dev

java.lang.ClassNotFoundException:javax.mail.MessagingException

来自分类Dev

java.lang.NoClassDefFoundError:javax / mail / MessagingException未解决

来自分类Dev

如何解决javax.mail.MessagingException:220

来自分类Dev

错误:程序包javax.mail不存在

Related 相关文章

  1. 1

    解决错误javax.mail.AuthenticationFailedException

  2. 2

    javax.mail.AuthenticationFailedException:如何无法通过Java发送邮件?

  3. 3

    JavaMail异常javax.mail.AuthenticationFailedException 534-5.7.9需要特定于应用程序的密码

  4. 4

    找到javax.mail.AuthenticationFailedException:连接失败,未指定密码?在收听密码正确的新邮件时

  5. 5

    错误:发生了JNI错误(javax.mail.jar)

  6. 6

    javax.mail.SendFailedException

  7. 7

    寻找JAVAX.Mail Jar

  8. 8

    域未处理的异常发生后,MemoryCache总是返回null

  9. 9

    如果发生故障,LoadLibrary是否返回NULL或错误代码<32?

  10. 10

    Slick2D getGraphics()返回null,发生空指针异常

  11. 11

    sending email with ssl using javax.mail

  12. 12

    javax mail getReceivedDate在发送者的时区

  13. 13

    是javax / mail / async中'Transport'的方法'send'

  14. 14

    javax.mail.Session的用途是什么?

  15. 15

    Maven忽略了javax.mail的提供范围

  16. 16

    javax mail getReceivedDate在发送者的时区

  17. 17

    是javax / mail / async中'Transport'的方法'send'

  18. 18

    Wildfly 10.1.0 ClassNotFoundException:javax.mail.Authenticator

  19. 19

    javax.mail.Part.getContent() ArrayIndexOutOfBoundsException: 16448

  20. 20

    javax.mail:不选择属性

  21. 21

    返回new []时发生NullPointerException

  22. 22

    Maven Jetty插件:javax.mail.Session无法转换为javax.mail.Session

  23. 23

    null == null返回false?

  24. 24

    null == null返回false?

  25. 25

    搜索javax邮件并返回找到的单词

  26. 26

    java.lang.ClassNotFoundException:javax.mail.MessagingException

  27. 27

    java.lang.NoClassDefFoundError:javax / mail / MessagingException未解决

  28. 28

    如何解决javax.mail.MessagingException:220

  29. 29

    错误:程序包javax.mail不存在

热门标签

归档