Skip to content

Instantly share code, notes, and snippets.

@ghooghe
Created December 2, 2013 13:14
Show Gist options
  • Save ghooghe/7749251 to your computer and use it in GitHub Desktop.
Save ghooghe/7749251 to your computer and use it in GitHub Desktop.
Write MimeMessage to .eml file
File eml = File.createTempFile("mailservice-output", ".eml");
OutputStream out = new FileOutputStream(eml);
msg.writeTo(out);
logger.debug("Temporary e-mail file written to {}", eml.getAbsolutePath());
IOUtils.closeQuietly(out);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment