我正在将图像作为base64字符串发送到API。
如何将该图像添加为电子邮件的附件?
我正在使用Spring boot和MimeMessageHelper,如下所示:
MimeMessage message = emailSender.createMimeMessage();
MimeMessageHelper helper = new MimeMessageHelper(message, true);
helper.setTo("myemail@gmail.com");
helper.setSubject("Test");
helper.setText(emailMsg, true);
String attachment = formData.get("image").getAsString(); // the bas64 encoded string
emailSender.send(message);