PPTX DOCX XLSX PDF ODP
Aspose.Email  for C++
EML

Extract EML Metadata via C++

Build your own C++ apps to add, edit, remove or extract metadata from EML files using server-side APIs.

How to Get EML Metadata Using C++

In order to extract EML metadata, we’ll use

Aspose.Email for C++

API which is a feature-rich, powerful and easy to use document metadata extraction API for C++ platform. You can download its latest version directly, just open

NuGet

package manager, search for Aspose.Email.Cpp and install. You may also use the following command from the Package Manager Console.

<h3>Command</h3>

PM> Install-Package Aspose.Email.Cpp

Steps to Extract Metadata of EML via C++

Get the type of the message while using GetProperties which in turn allows getting all metadata information via a simple loop.

  • Load the EML file via MapiMessage::FromFile
  • Get properties collection using get_Properties()
  • Get the respective property using idx_get

System Requirements

Aspose.Email for C++ supports on all major platforms and Operating Systems. Please make sure that you have the following prerequisites.

  • Microsoft Windows or a compatible OS with C++ Runtime Environment for Windows 32 bit, Windows 64 bit and Linux 64 bit.
  • Aspose.Email for C++ DLL referenced in your project.
 

Extract Metadata of EML - C++


// Load from file
System::SharedPtr<MapiMessage> eml = MapiMessage::FromFile(dataDir + L"message.eml");
    
System::String subject;
    
// Access the MapiPropertyTag.PR_SUBJECT property
System::SharedPtr<MapiProperty> prop = eml->get_Properties()->idx_get(MapiPropertyTag::PR_SUBJECT);
    
// If the property is not found, check the MapiPropertyTag.PR_SUBJECT_W (which is a // Unicode peer of the MapiPropertyTag.PR_SUBJECT)
if (prop == nullptr){
    prop = eml->get_Properties()->idx_get(MapiPropertyTag::PR_SUBJECT_W);
}
    
// Cannot found
if (prop == nullptr){
    System::Console::WriteLine(L"No property found!");
    return;
}
    
// Get the property data as string
subject = prop->GetString();
    
System::Console::WriteLine(System::String(L"Subject:") + subject);
// Read internet code page property
prop = msg->get_Properties()->idx_get(MapiPropertyTag::PR_INTERNET_CPID);
if (prop != nullptr){
    System::Console::WriteLine(System::String(L"CodePage:") + prop->GetLong());
}  
 
  • About Aspose.Email for C++ API

    Aspose.Email is a Microsoft Outlook and Thunderbird formats parsing solution. One can easily create, manipulate, convert email and storage formats such as MSG, EMLX, EML and MHT. Handling of email attachments, customization of message headers and implementation of different network protocols like POP3, IMAP & SMTP to send & receive emails is much easier. Its a standalone API and does not require Microsoft Outlook or any other software installation.

    Extract Metadata of EML via Online App

    View & edit Metadata to EML documents by using our Live Demos with following benefits.

      No need to download or setup anything
      No need to write any code
      Just upload your EML file & edit document properties
      Instantly get the download link for the resultant file

    EML What is EML File Format

    EML file format represents email messages saved using Outlook and other relevant applications. Almost all emailing clients support this file format for its compliance with RFC-822 Internet Message Format Standard. Microsoft Outlook is the default software for opening EML message types. EML files can be used for saving to disc as well as sending out to recipients using communication protocols.

    Read More

    Other Supported Metadata Formats

    Using C++, One can also manipulate metadata of many other formats including

    MBOX (Electronic Mail Messages)
    MSG (Outlook & Exchange Format)
    OST (Offline Storage Files)
    PST (Outlook Personal Storage Files)