-1

I use seam mail and javamail to send emails from our java ee web application and would like to log the rendered html of each to be viewed later so we can keep a record of what is being sent.

Has anyone done this or seen it done as there is not a great deal online about it.

Thanks

Greg222
  • 41
  • 4

1 Answers1

0

Not sure about rendered storage - but saving the MIME message itself is as simple as

MimeMessage mimeMessage = ... //the Mail you just sent try(OutputStream os = new FileOutputStream("store.eml")) { mimeMessage.writeTo(os); } catch(Exception e) { e.printStackTrace(); //Deal with it }

From this format you can always reconstruct all the parts sent to the recipient.

Jan
  • 13,738
  • 3
  • 30
  • 55