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 sendAttachmentsMail() {
  		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" + 
  				"	<font color=\"red\">发送html</font>\r\n" + 
  				"</body>\r\n" + 
  				"</html>";
  		String path = MailServiceTest.class.getClassLoader().getResource("image.jpg").getPath();
  		mailService.sendAttachmentsMail("1165904938@qq.com", "这是一个测试邮件", html, path);
  	}
test_case.class_method_signature: MailServiceTest.sendAttachmentsMail()
test_case.full_signature: @Test public void sendAttachmentsMail()
test_case.identifier: sendAttachmentsMail
test_case.invocations: getPath getResource getClassLoader sendAttachmentsMail
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void sendAttachmentsMail()
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 sendAttachmentsMail(String toMail,String subject,String content,String filePath) {
     	 	MimeMessage message = sender.createMimeMessage();
          try {
              MimeMessageHelper helper = new MimeMessageHelper(message, true);
              helper.setFrom(formMail);
              helper.setTo(toMail);
              helper.setSubject(subject);
              helper.setText(content, true);
              FileSystemResource file = new FileSystemResource(new File(filePath));
              String fileName = filePath.substring(filePath.lastIndexOf("/"));
              helper.addAttachment(fileName, file);
              sender.send(message);
              logger.info("发送给"+toMail+"带附件的邮件已经发送。");
          } catch (MessagingException e) {
              e.printStackTrace();
              logger.error("发送给"+toMail+"带附件的邮件时发生异常！", e);
          }
      }
focal_method.class_method_signature: MailService.sendAttachmentsMail(String toMail,String subject,String content,String filePath)
focal_method.full_signature: public void sendAttachmentsMail(String toMail,String subject,String content,String filePath)
focal_method.identifier: sendAttachmentsMail
focal_method.invocations: createMimeMessage setFrom setTo setSubject setText substring lastIndexOf addAttachment send info printStackTrace error
focal_method.modifiers: public
focal_method.parameters: (String toMail,String subject,String content,String filePath)
focal_method.return: void
focal_method.signature: void sendAttachmentsMail(String toMail,String subject,String content,String filePath)