Aspose.Email FOSS za C++ je MIT-licencirana, open-source C++ biblioteka za rad s Microsoft Outlook .msg datotekama i Compound File Binary (CFB) kontejnerima. Uključite zaglavlja putem CMake-a i odmah počnite čitati, stvarati i obrađivati e‑mail poruke bez instaliranja Microsoft Outlooka ili bilo kojeg vlasničkog runtimea.
Biblioteka pruža dvije razine pristupa. Na niskoj razini, cfb_reader i cfb_writer daju potpunu kontrolu nad CFB binary containers — prolazite kroz unose direktorija, čitate i pišete čvorove pohrane i podatke toka, te pregledavate sirovi raspored sektora. msg_reader i msg_writer obrađuju MSG format na vrhu CFB, izlažući MAPI property streams, recipient tables i attachment sub-storages. Na visokoj razini, mapi_message vam omogućuje stvaranje novih poruka od nule, čitanje subjects, bodies, recipients i attachments, te konverziju između MSG i EML format.
Biblioteka se može izgraditi na bilo kojoj platformi s C++17 kompajlerom i nema vanjske ovisnosti, što je čini prikladnom za Windows, Linux, macOS, Docker kontejnere i ugrađene sustave.
Enterprise izdanje s dodatnim značajkama nudi se kao Aspose.Email for C++.
cfb_reader::from_file(), cfb_reader::from_stream() ili cfb_reader::from_bytes().storage_ids(), stream_ids() i child_ids(), te navigirajte ugniježdenim hijerarhijama s resolve_path().cfb_node::is_storage() i cfb_node::is_stream(), pročitajte vremenske oznake putem creation_time() i modified_time().cfb_document i serijalizirajte u bajtove ili datoteku putem cfb_writer::to_bytes() ili cfb_writer::write_file()..msg datoteke — izravan CFB pristup omogućuje forenzičku inspekciju i popravak.msg_reader::from_file() ili msg_reader::from_stream() i pristupite temeljim MAPI tokovima svojstava i podskladištima privitaka.msg_document s msg_writer::to_bytes() ili msg_writer::write_file().msg_document::major_version(), msg_document::minor_version() i provjerite strogoću s msg_document::strict().msg_document::to_cfb_document()..msg datoteka iz direktorija arhive i izdvajanje metapodataka ili privitaka.mapi_message::create(), zatim postavi predmet, tijelo i HTML tijelo putem set_subject(), set_body() i set_html_body().set_sender_name(), set_sender_email_address() i set_sender_address_type() za odlaznu poruku.mapi_attachment::from_bytes() i mapi_attachment::from_stream(), te provjerite ima li ugrađenih poruka putem is_embedded_message().mapi_message::save() i ponovo učitaj s mapi_message::from_file() ili mapi_message::from_stream()..eml datoteku (RFC 5322 / MIME) u potpuni mapi_message objekt putem mapi_message::load_from_eml().mapi_message natrag u MIME format s save_to_eml()..eml i .msg datoteka u jedinstveni format.Otvorite Outlook MSG datoteku iz toka i ispišite predmet — nije potreban Microsoft Outlook.
#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';
}
Izradite potpunu e‑mail poruku s pošiljateljem, primateljem i privitkom, a zatim je spremite u oba formata MSG i EML.
#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");
message.add_recipient("bob@example.com", "Bob");
message.add_attachment("note.txt", std::vector<std::uint8_t>{'a', 'b', 'c'}, "text/plain");
std::ofstream msg_output("hello.msg", std::ios::binary);
message.save(msg_output);
std::ofstream eml_output("hello.eml", std::ios::binary);
message.save_to_eml(eml_output);
}