public static void writeMimeMessage()

in src/main/java/org/apache/commons/mail/util/MimeMessageUtils.java [131:144]


    public static void writeMimeMessage(final MimeMessage mimeMessage, final File resultFile)
        throws MessagingException, IOException
    {
        if (!resultFile.getParentFile().exists() && !resultFile.getParentFile().mkdirs())
        {
            throw new IOException(
                    "Failed to create the following parent directories: "
                            + resultFile.getParentFile());
        }
        try (FileOutputStream fos = new FileOutputStream(resultFile)) {
            mimeMessage.writeTo(fos);
            fos.flush();
        }
    }