EmlRootPackage
Inheritance: java.lang.Object, com.groupdocs.metadata.core.MetadataPackage, com.groupdocs.metadata.core.RootMetadataPackage, com.groupdocs.metadata.core.EmailRootPackage
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())); } // … }
Methods
Method | Description |
---|---|
getEmlPackage() | Gets the EML metadata package. |
getEmlPackage()
public final EmlPackage getEmlPackage()
Gets the EML metadata package.
Returns: EmlPackage - The EML metadata package.