com.groupdocs.metadata.core

Interfaces

Classes

Exceptions

com.groupdocs.metadata.core

Class EmlRootPackage

  • All Implemented Interfaces:
    Iterable<MetadataProperty>


    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()));
         }
         // ...
     }
     
    • Method Detail

      • getEmlPackage

        public final EmlPackage getEmlPackage()

        Gets the EML metadata package.

        Returns:
        The EML metadata package.