包装了一个用qq邮箱发邮件的类
当需要在邮件中加入表格时:
LinkedList<String> td= Lists.newLinkedList();
td.add(MyEmailService.buildTableTd("小明","18","1234567895"));//可以在不同的代码逻辑中获取某一行各个列的值
td.add(MyEmailService.buildTableTd("小白","20","1234567896"));
String [] to={
"XXXXXXXX@qq.com"};
MyEmailService.sendEmail(to,"测试企业级邮件发送器",MyEmailService.buildTable().setTh("姓名","年龄","电话").setTd(td).build("表格前面加的话","表格后面加的话"));
效果:
代码实现:
/**
* @author changfeng csdn
*/
public class MyEmailService {
public static void sendEmail(