@Test public void sendTextEmailTest() { mailService.sendTextMail(to, "发送文本邮件", "hello，这是Spring Boot发送的一封文本邮件!"); }
public void sendTextMail(String to, String subject, String content) { SimpleMailMessage message = new SimpleMailMessage(); message.setTo(to); message.setSubject(subject); message.setText(content); message.setFrom(from); javaMailSender.send(message); }
MailService { public void sendTextMail(String to, String subject, String content) { SimpleMailMessage message = new SimpleMailMessage(); message.setTo(to); message.setSubject(subject); message.setText(content); message.setFrom(from); javaMailSender.send(message); } }
MailService { public void sendTextMail(String to, String subject, String content) { SimpleMailMessage message = new SimpleMailMessage(); message.setTo(to); message.setSubject(subject); message.setText(content); message.setFrom(from); javaMailSender.send(message); }  }
MailService { public void sendTextMail(String to, String subject, String content) { SimpleMailMessage message = new SimpleMailMessage(); message.setTo(to); message.setSubject(subject); message.setText(content); message.setFrom(from); javaMailSender.send(message); }  void sendTextMail(String to, String subject, String content); void sendHtmlMail(String to, String subject, String content); void sendAttachmentMail(String to, String subject, String content, String[] filePathList); void sendHtmlInlinePhotoMail(String to, String subject, String content, String srcPath, String srcId); }
MailService { public void sendTextMail(String to, String subject, String content) { SimpleMailMessage message = new SimpleMailMessage(); message.setTo(to); message.setSubject(subject); message.setText(content); message.setFrom(from); javaMailSender.send(message); }  void sendTextMail(String to, String subject, String content); void sendHtmlMail(String to, String subject, String content); void sendAttachmentMail(String to, String subject, String content, String[] filePathList); void sendHtmlInlinePhotoMail(String to, String subject, String content, String srcPath, String srcId);  }