기능

기능 개요

Aspose.Email FOSS for C++는 Outlook MSG 파일 및
복합 파일 바이너리(CFB) 컨테이너 작업을 위한 계층형 API를 제공합니다. 라이브러리는 두 개의
하위 시스템인 CFB와 MSG/MAPI에 걸쳐 26개의 공개 클래스를 보유하고 있습니다.


CFB 컨테이너 액세스

CFB 서브시스템은 Microsoft Compound File Binary 형식을 읽고 쓰며 — Outlook .msg 파일의 기반이 되는 컨테이너 형식입니다.

클래스목적
cfb_reader기존 CFB 파일을 열고 탐색합니다
cfb_writerCFB 문서를 바이트 또는 파일로 직렬화합니다
cfb_documentCFB 파일의 메모리 내 표현
cfb_node디렉터리 트리의 개별 저장소 또는 스트림 노드
cfb_storage이름이 지정된 저장소 항목
cfb_stream바이너리 데이터를 포함한 이름이 지정된 스트림

핵심 작업:

  • 파일, 스트림 또는 바이트에서 열기: cfb_reader::from_file(), cfb_reader::from_stream(), cfb_reader::from_bytes(), cfb_reader::from_buffer()
  • 내용 열거: storage_ids(), stream_ids(), child_ids(), directory_entry_count()
  • 경로별 탐색: find_child_by_name(), resolve_path()
  • 노드 검사: cfb_node::is_storage(), cfb_node::is_stream(), creation_time(), modified_time()
  • 컨테이너 쓰기: cfb_writer::to_bytes(), cfb_writer::write_file(), cfb_writer::write_stream()

MSG 파일 읽기 및 쓰기

MSG 서브시스템은 CFB 위에서 Outlook 메시지 형식을 처리합니다.

클래스목적
msg_readerMSG 파일을 열고 구문 분석합니다
msg_writerMSG 문서를 직렬화합니다
msg_documentMSG 파일의 메모리 내 표현

핵심 작업:

  • MSG 파일 열기: msg_reader::from_file(), msg_reader::from_stream()
  • 메타데이터 검사: msg_document::major_version(), msg_document::minor_version(), msg_document::strict()
  • MSG 파일 쓰기: msg_writer::to_bytes(), msg_writer::write_file(), msg_writer::write_stream()
  • CFB 로 변환: msg_document::to_cfb_document() for low-level CFB access

고급 MAPI 메시지 API

mapi_message 클래스는 이메일 메시지를 생성하고, 읽으며, 변환하기 위한 고수준 인터페이스를 제공합니다.

메시지 만들기:

  • mapi_message::create() — 새 메시지를 주제와 본문으로 빌드합니다
  • set_subject(), set_body(), set_html_body() — 메시지 내용을 설정합니다
  • set_sender_name(), set_sender_email_address(), set_sender_address_type() — 보낸 사람을 설정합니다
  • set_internet_message_id() — Message-ID 헤더를 설정합니다
  • set_message_class() — MAPI 메시지 클래스를 설정합니다
  • unicode_strings() / set_unicode_strings() — Unicode 문자열 인코딩을 제어합니다

메시지 로드 중:

  • mapi_message::from_file() — 파일 경로에서 로드
  • mapi_message::from_stream() — 입력 스트림에서 로드
  • mapi_message::from_msg_document()msg_document에서 로드

메시지 저장:

  • save() — 바이트, 스트림 또는 파일로 직렬화
  • to_msg_document() — 저수준 액세스를 위해 msg_document 로 변환

첨부 파일:

  • mapi_attachment::from_bytes(), mapi_attachment::from_stream() — 첨부 파일 데이터 로드
  • mapi_attachment::is_embedded_message() — 첨부 파일이 임베디드 MSG인지 확인
  • mapi_attachment::load_data() — 첨부 파일 내용을 지연 로드

MAPI 속성:

  • mapi_property::property_id(), property_type(), property_tag() — 속성 식별
  • mapi_property::set_value(), flags(), set_flags() — 속성 조작
  • mapi_property_collection::remove() — 컬렉션에서 속성 제거

EML 및 MIME 변환

Outlook MSG 형식과 표준 EML(RFC 5322 / MIME) 간 변환:

  • mapi_message::load_from_eml().eml 파일을 mapi_message 로 구문 분석
  • mapi_message::save_to_eml()mapi_message 을 EML 형식으로 직렬화

제목, 본문, 발신자, 수신자 및 첨부 파일은 라운드 트립 동안 보존됩니다.


열거형 및 상수

EnumPurpose
common_message_property_id표준 MAPI 속성 식별자(제목, 본문, 발신자, 첨부 파일)
property_type_codeMAPI 속성 유형 코드(정수, 문자열, 바이너리, 시간, GUID)
msg_storage_roleMSG 파일 내 저장소 역할(메시지, 수신자, 첨부 파일)
directory_object_typeCFB 디렉터리 항목 유형(스토리지, 스트림, 루트)
directory_color_flagCFB 디렉터리 항목에 대한 레드-블랙 트리 색상 플래그
sector_markerCFB 파일 할당 테이블의 특수 섹터 값
 한국어