|
@@ -34,7 +34,7 @@ public class EmailTool {
|
|
|
properties.put("mail.smtp.host", "smtp.qq.com");
|
|
properties.put("mail.smtp.host", "smtp.qq.com");
|
|
|
properties.put("mail.smtp.port", "25");
|
|
properties.put("mail.smtp.port", "25");
|
|
|
properties.put("mail.smtp.auth", "true");
|
|
properties.put("mail.smtp.auth", "true");
|
|
|
- Authenticator authenticator = new EmailAuthenticator("[email protected]", "svbykovbevxjbdcg");
|
|
|
|
|
|
|
+ Authenticator authenticator = new EmailAuthenticator("[email protected]", "zasebxmzragmbchh");
|
|
|
javax.mail.Session sendMailSession = javax.mail.Session.getDefaultInstance(properties, authenticator);
|
|
javax.mail.Session sendMailSession = javax.mail.Session.getDefaultInstance(properties, authenticator);
|
|
|
MimeMessage mailMessage = new MimeMessage(sendMailSession);
|
|
MimeMessage mailMessage = new MimeMessage(sendMailSession);
|
|
|
try {
|
|
try {
|
|
@@ -98,7 +98,7 @@ public class EmailTool {
|
|
|
// 通过session得到transport对象
|
|
// 通过session得到transport对象
|
|
|
Transport ts = session.getTransport();
|
|
Transport ts = session.getTransport();
|
|
|
// 连接邮件服务器:邮箱类型,帐号,授权码代替密码(更安全),自行修改账号和授权码
|
|
// 连接邮件服务器:邮箱类型,帐号,授权码代替密码(更安全),自行修改账号和授权码
|
|
|
- ts.connect("smtp.qq.com", "[email protected]", "svbykovbevxjbdcg");// 后面的字符是授权码
|
|
|
|
|
|
|
+ ts.connect("smtp.qq.com", "[email protected]", "zasebxmzragmbchh");// 后面的字符是授权码
|
|
|
// 创建邮件
|
|
// 创建邮件
|
|
|
Message message = createSimpleMail(session, toEmailAddress, content);
|
|
Message message = createSimpleMail(session, toEmailAddress, content);
|
|
|
// 发送邮件
|
|
// 发送邮件
|