[英]Why does this Java Mail call fail in JDK 1.5, but succeed in 1.6?
When I run the following code with JDK 1.5, the last line fails, but when I run it with JDK 1.6 it succeeds. 当我使用JDK 1.5运行以下代码时,最后一行失败,但是当我使用JDK 1.6运行它时,它成功了。 Why is this?
为什么是这样?
Code: 码:
Session session;
session = Session.getDefaultInstance(properties,
new javax.mail.Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
// Create a default MimeMessage object.
MimeMessage message = new MimeMessage(session);
通过询问有关缺少激活JAR的评论来得出结论。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.