FAQ — Aspose.Email FOSS for C++
Licensing
What license does Aspose.Email FOSS for C++ use?
MIT license. No license key is required. Use freely in personal, commercial, and open-source projects. The only obligation is to include the copyright notice and license text in copies of the software.
Can I use it in commercial products?
Yes. The MIT license permits unrestricted commercial use, including embedding in proprietary applications, with no royalty fees.
Installation
How do I install Aspose.Email FOSS for C++?
Clone the repository and add it as a CMake subdirectory:
git clone https://github.com/aspose-email-foss/Aspose.Email-FOSS-for-Cpp.gitIn your CMakeLists.txt:
add_subdirectory(Aspose.Email-FOSS-for-Cpp)
target_link_libraries(your_target PRIVATE aspose_email_foss)What compiler versions are supported?
Any C++17 compiler: GCC 9+, Clang 10+, or MSVC 2019+. The library builds on Windows, Linux, and macOS.
Are there any external dependencies?
No. The library has zero external dependencies. It uses only the C++ standard library.
Format Support
Which email formats are supported?
| Format | Read | Write |
|---|---|---|
| MSG (Outlook Message) | Yes | Yes |
| EML (RFC 5322 / MIME) | Yes | Yes |
| CFB (Compound File Binary) | Yes | Yes |
Can I convert between MSG and EML?
Yes. Load an EML file with mapi_message::load_from_eml() and save as MSG with
mapi_message::save(). Convert the other direction with mapi_message::from_file()
followed by save_to_eml().
API Usage
How do I read an MSG file?
Use mapi_message::from_file() or mapi_message::from_stream():
#include <fstream>
#include <iostream>
#include "aspose/email/foss/msg/mapi_message.hpp"
int main()
{
std::ifstream input("sample.msg", std::ios::binary);
auto message = aspose::email::foss::msg::mapi_message::from_stream(input);
std::cout << message.subject() << '\n';
}How do I create a new MSG file from scratch?
Use mapi_message::create() to build a message, set fields, and save:
#include <fstream>
#include "aspose/email/foss/msg/mapi_message.hpp"
int main()
{
auto message = aspose::email::foss::msg::mapi_message::create("Hello", "Body");
message.set_sender_name("Alice");
message.set_sender_email_address("alice@example.com");
std::ofstream output("hello.msg", std::ios::binary);
message.save(output);
}How do I access the low-level CFB container?
Use cfb_reader to open a CFB file and traverse its directory tree:
#include "aspose/email/foss/cfb/cfb_reader.hpp"
auto reader = aspose::email::foss::cfb::cfb_reader::from_file("file.msg");
auto storages = reader.storage_ids();
auto streams = reader.stream_ids();You can also navigate by path with resolve_path() or find a child by name with
find_child_by_name().
How do I write a CFB file?
Build a cfb_document, add storages and streams, then serialize with cfb_writer:
#include "aspose/email/foss/cfb/cfb_writer.hpp"
auto bytes = aspose::email::foss::cfb::cfb_writer::to_bytes(document);
// Or write directly to a file:
aspose::email::foss::cfb::cfb_writer::write_file(document, "output.cfb");Known Limitations
Does this library support IMAP, SMTP, or POP3?
No. Aspose.Email FOSS for C++ reads and writes local files only. It does not connect to mail servers.
Is TNEF (winmail.dat) supported?
No. Transport Neutral Encapsulation Format is not parsed or generated.
Is there a calendar or appointment API?
No. Calendar-specific MAPI properties can be accessed generically via the property methods, but there is no dedicated calendar API.
What is the current release version?
Version 0.1.0 — the first public release. The API may evolve in subsequent versions.