test_class.declarator: mailService
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private MailService mailService;
test_class.type: MailService
test_class.var_name: mailService
test_class.file: spring-boot-2.x_mail/src/test/java/cn/lijunkui/mail/MailServiceTest.java
test_class.identifier: MailServiceTest
test_case.body: @Test
  	public void sendInlineResourceMail() {
  		String html= "<!DOCTYPE html>\r\n" + 
  				"<html>\r\n" + 
  				"<head>\r\n" + 
  				"<meta charset=\"UTF-8\">\r\n" + 
  				"<title>Insert title here</title>\r\n" + 
  				"</head>\r\n" + 
  				"<body>\r\n" + 
  				"<img src=\"cid:image1\"/> "+
  				"<img src=\"cid:image2\"/> "+
  				"	<font color=\"red\">发送html</font>\r\n" + 
  				"</body>\r\n" + 
  				"</html>";
  		List<InlineResource> list = new ArrayList<InlineResource>();
  		String path = MailServiceTest.class.getClassLoader().getResource("image.jpg").getPath();
  		
  		InlineResource resource = new InlineResource("image1",path);
  		InlineResource resource2 = new InlineResource("image2",path);
  		
  		list.add(resource2);
  		list.add(resource);
  		mailService.sendInlineResourceMail("ljk163wy@163.com", "头像图片", html,list);
  		//mailService.sendInlineResourceMail("******@163.com", "这是一个测试邮件", html,list);
  	}
test_case.class_method_signature: MailServiceTest.sendInlineResourceMail()
test_case.full_signature: @Test public void sendInlineResourceMail()
test_case.identifier: sendInlineResourceMail
test_case.invocations: getPath getResource getClassLoader add add sendInlineResourceMail
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void sendInlineResourceMail()
focal_class.declarator: logger = LoggerFactory.getLogger(this.getClass())
focal_class.modifier: private final
focal_class.original_string: private final Logger logger = LoggerFactory.getLogger(this.getClass());
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: sender
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private JavaMailSender sender;
focal_class.type: JavaMailSender
focal_class.var_name: sender
focal_class.declarator: formMail
focal_class.modifier: @Value("${spring.mail.username}")
  	private
focal_class.original_string: @Value("${spring.mail.username}")
  	private String formMail;
focal_class.type: String
focal_class.var_name: formMail
focal_class.file: spring-boot-2.x_mail/src/main/java/cn/lijunkui/mail/MailService.java
focal_class.identifier: MailService
focal_class.class_method_signature: MailService.sendSimpleMail(String toMail,String subject,String content)
focal_class.full_signature: public void sendSimpleMail(String toMail,String subject,String content)
focal_class.identifier: sendSimpleMail
focal_class.modifiers: public
focal_class.parameters: (String toMail,String subject,String content)
focal_class.return: void
focal_class.signature: void sendSimpleMail(String toMail,String subject,String content)
focal_class.class_method_signature: MailService.sendHtmlMail(String toMail,String subject,String content)
focal_class.full_signature: public void sendHtmlMail(String toMail,String subject,String content)
focal_class.identifier: sendHtmlMail
focal_class.modifiers: public
focal_class.parameters: (String toMail,String subject,String content)
focal_class.return: void
focal_class.signature: void sendHtmlMail(String toMail,String subject,String content)
focal_class.class_method_signature: MailService.sendInlineResourceMail(String toMail,String subject,String content,List<InlineResource> resourceist)
focal_class.full_signature: public void sendInlineResourceMail(String toMail,String subject,String content,List<InlineResource> resourceist)
focal_class.identifier: sendInlineResourceMail
focal_class.modifiers: public
focal_class.parameters: (String toMail,String subject,String content,List<InlineResource> resourceist)
focal_class.return: void
focal_class.signature: void sendInlineResourceMail(String toMail,String subject,String content,List<InlineResource> resourceist)
focal_class.class_method_signature: MailService.sendInlineResourceMailForGroupSending(String[] toMail,String subject,String content,List<InlineResource> resourceist)
focal_class.full_signature: public void sendInlineResourceMailForGroupSending(String[] toMail,String subject,String content,List<InlineResource> resourceist)
focal_class.identifier: sendInlineResourceMailForGroupSending
focal_class.modifiers: public
focal_class.parameters: (String[] toMail,String subject,String content,List<InlineResource> resourceist)
focal_class.return: void
focal_class.signature: void sendInlineResourceMailForGroupSending(String[] toMail,String subject,String content,List<InlineResource> resourceist)
focal_class.class_method_signature: MailService.sendAttachmentsMail(String toMail,String subject,String content,String filePath)
focal_class.full_signature: public void sendAttachmentsMail(String toMail,String subject,String content,String filePath)
focal_class.identifier: sendAttachmentsMail
focal_class.modifiers: public
focal_class.parameters: (String toMail,String subject,String content,String filePath)
focal_class.return: void
focal_class.signature: void sendAttachmentsMail(String toMail,String subject,String content,String filePath)
focal_method.body: public void sendInlineResourceMail(String toMail,String subject,String content,List<InlineResource> resourceist) {
  		MimeMessage message = sender.createMimeMessage();
  		try {
  			MimeMessageHelper helper = new MimeMessageHelper(message, true);
  			helper.setFrom(formMail);
  			helper.setCc(formMail);// 邮件抄送给自己防止发送不成功！com.sun.mail.smtp.SMTPSendFailedException: 554 DT:SPM 126 smtp9
  			helper.setTo(toMail);
  			helper.setSubject(subject);
  			helper.setText(content, true);
  			for (InlineResource inlineResource : resourceist) {
  				FileSystemResource res = new FileSystemResource(new File(inlineResource.getPath()));
  				helper.addInline(inlineResource.getCid(),res);
  			}
  			sender.send(message);
  			logger.info("嵌入静态资源的邮件已经发送。");
  		} catch (MessagingException e) {
  			logger.error("发送嵌入静态资源的邮件时发生异常！", e);
  			e.printStackTrace();
  		}catch (Exception e) {
  			logger.error("发送嵌入静态资源的邮件时发生异常！", e);
  			e.printStackTrace();
  		}
  	}
focal_method.class_method_signature: MailService.sendInlineResourceMail(String toMail,String subject,String content,List<InlineResource> resourceist)
focal_method.full_signature: public void sendInlineResourceMail(String toMail,String subject,String content,List<InlineResource> resourceist)
focal_method.identifier: sendInlineResourceMail
focal_method.invocations: createMimeMessage setFrom setCc setTo setSubject setText getPath addInline getCid send info error printStackTrace error printStackTrace
focal_method.modifiers: public
focal_method.parameters: (String toMail,String subject,String content,List<InlineResource> resourceist)
focal_method.return: void
focal_method.signature: void sendInlineResourceMail(String toMail,String subject,String content,List<InlineResource> resourceist)