| | |
| | | // 访问SMTP服务时需要提供的密码(在控制台选择发信地址进行设置) |
| | | props.put("mail.password", properties.getPassword()); |
| | | props.setProperty("mail.smtp.socketFactory.fallback", "false"); |
| | | props.put("mail.smtp.ssl.enable", "false"); |
| | | props.put("mail.smtp.ssl.enable", "true"); |
| | | props.put("mail.smtp.ssl.protocols", "TLSv1.2"); |
| | | // 构建授权信息,用于进行SMTP进行身份验证 |
| | | Authenticator authenticator = new Authenticator() { |
| | | @Override |
| | |
| | | TencentMailUtil tencentMailUtil = new TencentMailUtil(); |
| | | MailProperties properties = new MailProperties(); |
| | | tencentMailUtil.properties = properties; |
| | | tencentMailUtil.send("214491528@qq.com","大学城揽院24栋"); |
| | | tencentMailUtil.send("645025773@qq.com","大学城揽院24栋"); |
| | | |
| | | } |
| | | |