java mail 535 error_JavaMail authenticating 535 error

org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtp.163.com:25

at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1242)

at org.apache.commons.mail.Email.send(Email.java:1267)

at excelWatcher.MailUtil.send(MailUtil.java:35)

at excelWatcher.MailUtil.main(MailUtil.java:56)

Caused by: javax.mail.AuthenticationFailedException: 535 Error: authentication failed

at com.sun.mail.smtp.SMTPTransport$Authenticator.authenticate(SMTPTransport.java:826)

at com.sun.mail.smtp.SMTPTransport.authenticate(SMTPTransport.java:761)

at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:685)

at javax.mail.Service.connect(Service.java:317)

at javax.mail.Service.connect(Service.java:176)

at javax.mail.Service.connect(Service.java:125)

at javax.mail.Transport.send0(Transport.java:194)

at javax.mail.Transport.send(Transport.java:124)

at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1232)

... 3 more

log4j:WARN No appenders could be found for logger (excelWatcher.MailUtil).

log4j:WARN Please initialize the log4j system properly.

log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

如果你是163或者126邮箱,那么你检查一下你网页端邮箱设置中 SMTP开启的时候,有授权码的,你重新关闭SMTP服务再重新开启你就知道了,代码中登录的密码其实是授权码。注意注意!!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值