* @param headers the Enumeration which holds the headers
* @param headerOs the OutputStream to which the headers get written
* @throws MessagingException
*/
public static void writeHeadersTo(Enumeration headers, OutputStream headerOs) throws MessagingException {
PrintWriter hos = new InternetPrintWriter(new BufferedWriter(new OutputStreamWriter(headerOs), 512), true);
while (headers.hasMoreElements()) {
hos.println((String)headers.nextElement());
}
// Print header/data separator
hos.println();
hos.flush();
}