在使用JavaMailSender发送带附件的邮件时,报下面所示异常
java.lang.IllegalStateException: Not in multipart mode - create an appropriate MimeMessageHelper via a constructor that takes a 'multipart' flag if you need to set alternative texts or add inline elements or attachments.
代码:
@Test
public void sendAttachmentMail() throws MessagingException {
MimeMessage mimeMessage = mailSender.createMimeMessage(