以下是源代码.HtmlEmail e = new HtmlEmail();
e.setHostName("smtp.sina.cn");
e.setAuthentication("www_wyf","5201314" );
e.setCharset("utf-8");
try {
e.addTo("[email protected]");
e.setFrom("[email protected]" );
e.setSubject( "新用户注册验证邮件--518.wyf" );
String url ="http://localhost:8080/cp/index.jsp?u=" + loginuser + "&t=5";
e.setHtmlMsg( "<font color='red'>恭喜,你还差最后一步,就可以加入我要发,请点击下面的链接:</font><br />" + url);
// set the alternative message
e.setTextMsg("set the alternative message");
// set mail
e.send();
} catch (EmailException ex) {
// TODO Auto-generated catch block
ex.printStackTrace();
} 邮件能够发送。 可穿过去得超链接,把参数当成文字显示了。
e.setHostName("smtp.sina.cn");
e.setAuthentication("www_wyf","5201314" );
e.setCharset("utf-8");
try {
e.addTo("[email protected]");
e.setFrom("[email protected]" );
e.setSubject( "新用户注册验证邮件--518.wyf" );
String url ="http://localhost:8080/cp/index.jsp?u=" + loginuser + "&t=5";
e.setHtmlMsg( "<font color='red'>恭喜,你还差最后一步,就可以加入我要发,请点击下面的链接:</font><br />" + url);
// set the alternative message
e.setTextMsg("set the alternative message");
// set mail
e.send();
} catch (EmailException ex) {
// TODO Auto-generated catch block
ex.printStackTrace();
} 邮件能够发送。 可穿过去得超链接,把参数当成文字显示了。
解决方案 »
- struts2使用ModelDriven接收不到表单数据
- myeclipse在创建webservice的时候,没有XFile选项
- JAVA批量更新多个数据库表
- inputStream的处理
- spring配置的问题
- 关于dialog等一些小问题 谢谢大家先
- 想学GIS但不知道从什么地方入手
- jsp访问ejb的问题(我已经问了3次,没有人能说出个所以然!弄好马上结贴)
- 还没学JAVA,来问一问。
- 怎样能验证weblogic6.1+jbuilder7+sqlserver7有没有配置成功呢?
- 请教一下传统的javaweb开发(jsp+servlet+javabean)与SSH框架各有什么样的优缺点呢?
- 关于java反射的安全问题
e.setHtmlMsg( "<font color='red'>恭喜,你还差最后一步,就可以加入我要发,请点击下面的链接:</font><br /><a href=" + url + ">");
试试