Features
Feature Overview
Aspose.Email FOSS for C++ provides a layered API for working with Outlook MSG files and Compound File Binary (CFB) containers. The library has 26 public classes across two subsystems: CFB and MSG/MAPI.
CFB Container Access
The CFB subsystem reads and writes Microsoft Compound File Binary format — the container
format underlying Outlook .msg files.
| Class | Purpose |
|---|---|
cfb_reader | Open and traverse existing CFB files |
cfb_writer | Serialize CFB documents to bytes or files |
cfb_document | In-memory representation of a CFB file |
cfb_node | Individual storage or stream node in the directory tree |
cfb_storage | Named storage entry |
cfb_stream | Named stream with binary data |
Key operations:
- Open from file, stream, or bytes:
cfb_reader::from_file(),cfb_reader::from_stream(),cfb_reader::from_bytes(),cfb_reader::from_buffer() - Enumerate contents:
storage_ids(),stream_ids(),child_ids(),directory_entry_count() - Navigate by path:
find_child_by_name(),resolve_path() - Inspect nodes:
cfb_node::is_storage(),cfb_node::is_stream(),creation_time(),modified_time() - Write containers:
cfb_writer::to_bytes(),cfb_writer::write_file(),cfb_writer::write_stream()
MSG File Read and Write
The MSG subsystem handles Outlook message format on top of CFB.
| Class | Purpose |
|---|---|
msg_reader | Open and parse MSG files |
msg_writer | Serialize MSG documents |
msg_document | In-memory representation of an MSG file |
Key operations:
- Open MSG files:
msg_reader::from_file(),msg_reader::from_stream() - Inspect metadata:
msg_document::major_version(),msg_document::minor_version(),msg_document::strict() - Write MSG files:
msg_writer::to_bytes(),msg_writer::write_file(),msg_writer::write_stream() - Convert to CFB:
msg_document::to_cfb_document()for low-level CFB access
High-Level MAPI Message API
The mapi_message class provides a high-level interface for creating, reading, and
converting email messages.
Creating messages:
mapi_message::create()— build a new message with subject and bodyset_subject(),set_body(),set_html_body()— set message contentset_sender_name(),set_sender_email_address(),set_sender_address_type()— set senderset_internet_message_id()— set the Message-ID headerset_message_class()— set MAPI message classunicode_strings()/set_unicode_strings()— control Unicode string encoding
Loading messages:
mapi_message::from_file()— load from a file pathmapi_message::from_stream()— load from an input streammapi_message::from_msg_document()— load from anmsg_document
Saving messages:
save()— serialize to bytes, stream, or fileto_msg_document()— convert to anmsg_documentfor low-level access
Attachments:
mapi_attachment::from_bytes(),mapi_attachment::from_stream()— load attachment datamapi_attachment::is_embedded_message()— check if attachment is an embedded MSGmapi_attachment::load_data()— lazy-load attachment content
MAPI properties:
mapi_property::property_id(),property_type(),property_tag()— property identificationmapi_property::set_value(),flags(),set_flags()— property manipulationmapi_property_collection::remove()— remove properties from a collection
EML and MIME Conversion
Convert between Outlook MSG format and standard EML (RFC 5322 / MIME):
mapi_message::load_from_eml()— parse an.emlfile into amapi_messagemapi_message::save_to_eml()— serialize amapi_messageto EML format
Subject, body, sender, recipients, and attachments are preserved through round-trips.
Enums and Constants
| Enum | Purpose |
|---|---|
common_message_property_id | Standard MAPI property identifiers (subject, body, sender, attachments) |
property_type_code | MAPI property type codes (integer, string, binary, time, GUID) |
msg_storage_role | Storage roles within MSG files (message, recipient, attachment) |
directory_object_type | CFB directory entry types (storage, stream, root) |
directory_color_flag | Red-black tree color flags for CFB directory entries |
sector_marker | Special sector values in CFB file allocation tables |