java mail发送邮件时报错

javax.mail.AuthenticationFailedException: 535 5.7.8 Error: authentication failed: authentication failure

	at com.sun.mail.smtp.SMTPTransport$Authenticator.authenticate(SMTPTransport.java:809)
	at com.sun.mail.smtp.SMTPTransport.authenticate(SMTPTransport.java:752)
	at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:669)
	at javax.mail.Service.connect(Service.java:317)
	at javax.mail.Service.connect(Service.java:176)
	
2014-12-04 09:51:42,317 [ERROR] MailSendUtil - When sending mail, here catch exception!!!!! 
java.lang.IllegalStateException: Not connected
	at com.sun.mail.smtp.SMTPTransport.checkConnected(SMTPTransport.java:2206)
	at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1053)


   造成这个异常的原因是邮件客户端连接异常:一是IP地址连接异常,二是用户名密码错误,像我刚才的异常我ping邮箱客户端能ping上,但是仍然报这个错,经过检查发现是邮箱客户端的密码改了,而同事没有告诉我,把密码修改之后即可正常使用。

你可能感兴趣的:(java mail)