0

I have a Java POJO class that implements Jackson data mapping for JSON. I want to show the changes made to the object, by sending a Java email with the old version of the object, and the new version labeled accordingly. However, I don't want to create a System file for this process, I just want to add the objects to the email directly. I've seen several solutions that involve using an ObjectOutputStream to create a temp file in memory, and then use an InputStream using MimeMessageHelper to add as an attachment, but I'm wondering if this is the best solution, and if there is another way to achieve this goal that may be baked into the Java Mail Library.

user3334871
  • 1,251
  • 2
  • 14
  • 36

1 Answers1

1

Maybe that solution could be of help:

Send an E-Mail with attachment using JAVA Mail API without storing in local machine

I haven't used the Java Mail api in a long time, but I do recall being able to add an attachement from a stream.

Eric
  • 154
  • 6