| | |
| | | // 访问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 |
| | |
| | | }; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | private Multipart createMultipart(List<Map<String, String>> list) throws MessagingException, UnsupportedEncodingException, MalformedURLException { |
| | | Multipart multipart = new MimeMultipart(); |
| | | |