public class EmlRootPackage extends EmailRootPackage
Represents the root package allowing working with metadata in an EML email message.
Learn more
This code sample shows how to extract metadata from an EML message.
try (Metadata metadata = new Metadata(Constants.InputEml)) { EmlRootPackage root = metadata.getRootPackageGeneric(); System.out.println(root.getEmailPackage().getSender()); System.out.println(root.getEmailPackage().getSubject()); for (String recipient : root.getEmailPackage().getRecipients()) { System.out.println(recipient); } for (String attachedFileName : root.getEmailPackage().getAttachedFileNames()) { System.out.println(attachedFileName); } for (MetadataProperty header : root.getEmailPackage().getHeaders()) { System.out.println(String.format("%s = %s", header.getName(), header.getValue())); } // ... }
Modifier and Type | Method and Description |
---|---|
EmlPackage |
getEmlPackage()
Gets the EML metadata package.
|
clearAttachments, getEmailPackage
getFileType, sanitize
addProperties, contains, findProperties, get_Item, getCount, getKeys, getKnowPropertyDescriptors, getMetadataType, getPropertyDescriptors, iterator, removeProperties, setProperties, updateProperties
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public final EmlPackage getEmlPackage()
Gets the EML metadata package.