HtmlMail.java
上传用户:hensond
上传日期:2021-12-27
资源大小:817k
文件大小:1k
- package com.company.strategy;
- /**
- * @author cbf4Life cbf4life@126.com
- * I'm glad to share my knowledge with you all.
- */
- public class HtmlMail extends MailTemplate {
- public HtmlMail(String _from, String _to, String _subject, String _context) {
- super(_from, _to, _subject, _context);
- }
- public String getContext(){
- //超文本类型则设置邮件的格式为:multipart/mixed
- String context = "nContent-Type: multipart/mixed;charset=GB2312n"+super.getContext();
- //同时对邮件进行HTML检查,是否有类似未关闭的标签、不符合定义的标签等,这里用一句话来代替
- context = context + "n邮件格式为:超文本格式";
- return context;
- }
- }