MailService { public void sendSimpleMail(String toMail,String subject,String content) { SimpleMailMessage simpleMailMessage = new SimpleMailMessage(); simpleMailMessage.setFrom(formMail); simpleMailMessage.setTo(toMail); simpleMailMessage.setSubject(subject); simpleMailMessage.setText(content); try { sender.send(simpleMailMessage); logger.info("发送给"+toMail+"简单邮件已经发送。 subject："+subject); } catch (Exception e) { logger.info("发送给"+toMail+"send mail error subject："+subject); e.printStackTrace(); } }  void sendSimpleMail(String toMail,String subject,String content); void sendHtmlMail(String toMail,String subject,String content); void sendInlineResourceMail(String toMail,String subject,String content,List<InlineResource> resourceist); void sendInlineResourceMailForGroupSending(String[] toMail,String subject,String content,List<InlineResource> resourceist); void sendAttachmentsMail(String toMail,String subject,String content,String filePath);  }
@Test public void sendSimpleMail() { mailService.sendSimpleMail("******@qq.com", "这是一个测试邮件", "这是一个测试邮件"); }