当前位置: 代码迷 >> J2EE >> javamail的邮件发送老是有验证失败错误
  详细解决方案

javamail的邮件发送老是有验证失败错误

热度:431   发布时间:2016-04-22 03:24:29.0
javamail的邮件发送老是有验证失败异常
notingDEBUG: setDebug: JavaMail version 1.3.1
DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: trying to connect to host "smtp.sina.com", port 25

220 mail5-201.sinamail.sina.com.cn ESMTP
DEBUG SMTP: connected to host "smtp.sina.com", port: 25

EHLO HAOBO_TOA
250-mail5-201.sinamail.sina.com.cn
250-8BITMIME
250-SIZE 52428800
250-AUTH PLAIN LOGIN
250 AUTH=PLAIN LOGIN
DEBUG SMTP: Found extension "8BITMIME", arg ""
DEBUG SMTP: Found extension "SIZE", arg "52428800"
DEBUG SMTP: Found extension "AUTH", arg "PLAIN LOGIN"
DEBUG SMTP: Found extension "AUTH=PLAIN", arg "LOGIN"
DEBUG SMTP: Attempt to authenticate
AUTH LOGIN
334 VXNlcm5hbWU6
TEFOU0VZT1VZVVRBT0AxNjMuY29t
334 UGFzc3dvcmQ6
MTk4NjIxMA==
535 #5.7.0 Authentication failed
javax.mail.AuthenticationFailedException


------解决方案--------------------
每个邮箱都有自己smtp的,
String host = "sina.com"; 
你把这句改成
String host = "163.com"; 的啊