MimeMessageHelper.addAttachment() method does not add attachment to the MimeMessage
I try to make mailSender that is capable of sending emails with attachments using libraries jakarta.mail and org.springframework.mail.
Sending email with jakarta mail goes to spam when I add attachment. How to avoid?
I am using jakarta.mail
which is included in spring-boot-starter-mail
, for automating to send mails. I use gmail account for such purpose. I took an application password from google account for authentication. When I send plain mail (without any attachments), mail arrives to the inbox;