Exception in thread "main" javax.mail.AuthenticationFailedException: failed to connect
at javax.mail.Service.connect(Service.java:322)
at javax.mail.Service.connect(Service.java:172)
at javax.mail.Service.connect(Service.java:121)
at javax.mail.Transport.send0(Transport.java:190)
at javax.mail.Transport.send(Transport.java:120)
at cn.javamail.Demo1.main(Demo1.java:40)
原因:因测试邮箱163.com中未开启smtp服务
解决方法:在163邮箱中开启smtp和pop服务