class MailService {

	public void sendHtmlMail(String toMail,String subject,String content) {
		MimeMessage createMimeMessage = sender.createMimeMessage();
		
		try {
			//true表示需要创建一个multipart message 如何不设置就不会解析html
			MimeMessageHelper mimeMessageHelper = new MimeMessageHelper(createMimeMessage,true);
			mimeMessageHelper.setFrom(formMail);
			mimeMessageHelper.setTo(toMail);
			mimeMessageHelper.setSubject(subject);
			mimeMessageHelper.setText(content, true);
			sender.send(createMimeMessage);
			logger.info("发送给"+toMail+"html邮件已经发送。 subject："+subject);
		} catch (MessagingException e) {
			logger.info("发送给"+toMail+"html send mail error subject："+subject);
			e.printStackTrace();
			
		}
	}

}