// "\r\n.\r\n" sequence.
//
// The MIME output stream performs those two functions on behalf of
// the content
// writer.
OutputStream mimeOut = new MIMEOutputStream(outputStream);
msg.writeTo(mimeOut);
mimeOut.flush();
} catch (IOException e) {
throw new MessagingException(e.toString());
} catch (MessagingException e) {
throw new MessagingException(e.toString());
}