日期:2014-05-17 浏览次数:20963 次
HtmlEmail email = new HtmlEmail();
email.setHostName("smtp.sina.com");
email.setAuthentication("*****","*****");
email.setCharset("utf-8");
try {
email.addTo("*****");
email.setFrom("*****","*****");
email.setHtmlMsg("<a href='http://www.csdn.net'>csdn</a>");//加上http邮箱接收不到,去掉之后就没问题了...
email.send();
} catch (EmailException e) {
e.printStackTrace();
} catch (MalformedURLException e) {
e.printStackTrace();
}