package cn.estsh.i3plus.core.apiservice.util;

import cn.estsh.i3plus.core.apiservice.serviceimpl.busi.TestBase;
import cn.estsh.i3plus.pojo.base.enumutil.ImppEnumUtil;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import javax.mail.MessagingException;
import java.io.UnsupportedEncodingException;

/**
 * @Description :
 * @Reference :
 * @Author : yunhao
 * @CreateDate : 2018-11-21 19:44
 * @Modify:
 **/
public class TestMailUtil extends TestBase {

    @Autowired
    MailUtil mailUtil;

    @Test
    public void TestSendMail(){
        mailUtil.setTo("yunhao.wang@estsh.com");
        mailUtil.setSubject("中文");
        mailUtil.setContentType(ImppEnumUtil.MESSAGE_TYPE_CONTENT.HTML.getDescription());
        mailUtil.setBody("内容");
        try {
            mailUtil.send();
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        } catch (MessagingException e) {
            e.printStackTrace();
        }

    }
}
