시작하기

C++용 Aspose.Email FOSS 시작하기

**Aspose.Email FOSS for C++**에 오신 것을 환영합니다. 이 라이브러리는 무료이며 MIT 라이선스를 가진 C++ 라이브러리로, 읽고, 생성하고, Outlook MSG 파일 및 복합 파일 바이너리(CFB) 컨테이너를 씁니다. 이 가이드는 새 C++ 프로젝트에서 몇 분 안에 MSG 파일을 작업할 수 있도록 안내합니다.


전제 조건

요구 사항세부 사항
컴파일러C++17 이상 (GCC 9+, Clang 10+, MSVC 2019+)
빌드 시스템CMake 3.26 이상
OSWindows, macOS, 또는 Linux
종속성없음

설치

저장소를 복제하고 이를 CMake 하위 디렉터리로 추가하십시오:

git clone https://github.com/aspose-email-foss/Aspose.Email-FOSS-for-Cpp.git

귀하의 CMakeLists.txt:

add_subdirectory(Aspose.Email-FOSS-for-Cpp)
target_link_libraries(your_target PRIVATE AsposeEmailFoss::AsposeEmailFoss)

최소 프로그램으로 확인하십시오:

#include <iostream>
#include "aspose/email/foss/msg/mapi_message.hpp"

int main()
{
    auto message = aspose::email::foss::msg::mapi_message::create("Test", "Hello");
    std::cout << message.subject() << '\n';
    // Output: Test
}

자세한 프로젝트 설정을 위해 Installation Guide를 확인하십시오.


당신이 할 수 있는 일

설정이 완료되면 바로 다음을 할 수 있습니다:

  • 읽기 MSG 파일을 mapi_message::from_stream() 또는 mapi_message::from_file() 로 — 제목, 본문, 발신자, 수신자 및 첨부 파일에 접근
  • 생성 MSG 메시지를 mapi_message::create() 로 처음부터 — 모든 필드를 설정하고, 수신자와 첨부 파일을 추가한 뒤 save() 로 직렬화
  • 변환 MSG와 EML 사이를 load_from_eml()save_to_eml()
  • 검사 CFB 바이너리 컨테이너를 cfb_reader 로 — 저장소와 스트림을 탐색하고, 경로를 해결하며, 원시 바이트를 읽음
  • 쓰기 CFB 문서를 cfb_writer 로 포렌식 검사 또는 포맷 구성에 사용

빠른 시작

MSG 파일을 읽고 제목을 출력합니다:

#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';
}

다음 단계

 한국어