摘要: 最近项目中要做到重置密码并将新密码通过邮件发送给用户的功能,所以练习并学会了如何使用java发送邮件,代码如下:public static void sendMail(String mailTo, String newPwd) {//参数为收件人的邮箱地址及新密码 Properties pro = getProperties("ResetPwd.properties"); try { Properties mailPro = new Properties(); Authenticator auth = new EmailAutherticator(//发件人身份验证 pro 阅读全文
posted @ 2013-01-12 23:50 风儿飞 阅读(218) 评论(0) 推荐(0) 编辑