/** * Convenience method to take any MimeMessage and write the headers and body to two * different output streams * * @param message the MimeMessage reading from * @param headerOs the OutputStream writting the headers to * @param bodyOs the OutputStream writting the body to * @throws IOException get thrown if an IO Error detected while writing to the streams * @throws MessagingException get thrown if an error detected while reading the message */ public static void writeTo(MimeMessage message, OutputStream headerOs, OutputStream bodyOs) throws IOException, MessagingException { writeTo(message, headerOs, bodyOs, null); }