Commit c5fbba65 authored by Quxl's avatar Quxl

优化方法名

parent e4af8797
......@@ -39,7 +39,7 @@ public class MailUtil {
* @param emailTo 接收邮件地址
* @return 是否成功
*/
public static void sendMail(String host, Integer port, boolean is_auth, final String from, final String passwd, String subject, String content, File[] attachments, String... emailTo) {
public static void sendBySmtp(String host, Integer port, boolean is_auth, final String from, final String passwd, String subject, String content, File[] attachments, String... emailTo) {
Properties properties = new Properties();
properties.put("mail.smtp.host", host);
properties.put("mail.smtp.auth", is_auth ? "true" : "false");
......@@ -99,7 +99,7 @@ public class MailUtil {
// sender.send(mailMessage, "13384825689@163.com");
//String json = "{\"password\": \"hong804334\",\"port\": 25,\"protocol\": \"smtp\",\"smtpAuth\": \"true\",\"smtpHost\": \"smtp.163.com\",\"sslEnable\": \"false\",\"username\": \"13384825689@163.com\"}";
File[] files = new File[]{new File("C:/opt/modules/dev/boot/file/excel/40001-收银员资料维护-20180813.xlsx"), new File("C:/opt/modules/dev/boot/file/2018-08-15/admin_客单价对比图表.html"), new File("C:/opt/modules/dev/boot/file/2018-08-15/admin_销售对比图表.html")};
MailUtil.sendMail("smtp.163.com", 25, true, "13384825689@163.com", "hong804334", "测试aaa", "测hi", files, "13384825689@163.com");
MailUtil.sendBySmtp("smtp.163.com", 25, true, "13384825689@163.com", "hong804334", "测试aaa", "测hi", files, "13384825689@163.com");
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment