Package de.xima.fc.mail
Class MailArchiveUtils
java.lang.Object
de.xima.fc.mail.MailArchiveUtils
Utility class for archiving mail.
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
archive
(File targetFile, MandantMailData data, IBaseMailData mail, EEmailArchiveFormat format) Archives an email by writing it to aFile
.
-
Method Details
-
archive
public static void archive(File targetFile, MandantMailData data, IBaseMailData mail, EEmailArchiveFormat format) throws MailContextNotAvailableException, ArchiveException, Exception Archives an email by writing it to aFile
. It's content consist of subject, body, attachments, sender, receiver and date.- Parameters:
targetFile
- The file to write to.data
- Data regarding the client mail server to use. Whennull
or not available, uses the system mail server configuration.mail
- Email to send.format
- The chosen format for the archived mail.- Throws:
MailContextNotAvailableException
- When neither a client mail server nor a system mail server is available.ArchiveException
- When creating theMimeMessage
or writing it to aFile
fails.Exception
- When the archive file could not be created.
-