package com.cftech.cms.email_record.model;

import com.cftech.cms.SendEmail.EmailSenderWithAttach;
import com.cftech.cms.SendEmail.MailBean;
import com.cftech.cms.exhibi_material.model.Exhibi_material;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

/**
 * @Auther: lisw
 * @Date: 2019/6/27 11:20
 * @Description:
 */
public class EmailSendTest {
        public static void main(String[] args) {
                MailBean mb = new MailBean();
                mb.setHost("smtp.exmail.qq.com");
                mb.setUsername("postmaster@wx-aidea.cn");
                mb.setPassword("Ali190325");
                mb.setFrom("postmaster@wx-aidea.cn");
                mb.setTo("starsoy@163.com");
                mb.setSubject("邮件按钮测试");
                StringBuffer sb = new StringBuffer();
                sb.append("请审核:<br/>");
                sb.append("<a style=\" height: 21px;line-height: 21px;margin-left:5px;padding: 0 11px;background: #02bafa;border: 1px #26bbdb solid;border-radius: 3px;color: #fff;display: inline-block;text-decoration: none;font-size: 12px;outline: none;\" href=\"http://www.baidu.com\">同意</a>");
                sb.append("<a style=\" height: 21px;line-height: 21px;margin-left:5px;padding: 0 11px;background: #02bafa;border: 1px #26bbdb solid;border-radius: 3px;color: #fff;display: inline-block;text-decoration: none;font-size: 12px;outline: none;\" href=\"http://www.baidu.com\">拒绝</a>");
                mb.setContent(sb.toString());
                List<File> files = new ArrayList<File>();
                String [] results = EmailSenderWithAttach.sendAttachEmail(mb.getHost(),
                        mb.getFrom(),mb.getTo(),mb.getSubject(),mb.getContent(),files,mb.getUsername(),mb.getPassword(),"465",mb.getFilename());
        }
}
