C++를 통한 썬더버드 및 아웃룩 포맷 변환
Microsoft® Outlook 및 Thunderbird 이메일 파일 및 메시지 아카이브를 파싱하고 변환하여 C++ 애플리케이션을 빌드합니다.
형식 사양을 자세히 몰라도 C++ 이메일 API를 사용하여 MSG, EML, EMLX 및 MHT를 비롯한 형식을 구문 분석하여 메일 처리 솔루션을 구축할 수 있습니다.또한 개발자는 MIME 메시지, Outlook 형식을 관리하고 iCalendar (RFC 2445) 반복 패턴 등을 생성 및 사용할 수 있습니다.
이메일 형식을 다른 형식으로 저장
대부분의 아웃룩과 썬더버드 포맷의 경우 변환 과정이 간단합니다.여기서는 몇 가지 사례를 살펴보자면, EML에서 MHTML로 and MSG를 HTML로 헤더 정보 및 사용자 지정 시간대 포함첫 번째 경우에는 필요한 파일을 로드하세요. MailMessage ::필요한 확장자를 사용하여 Save 메서드를 로드하고 호출합니다. SaveOptions .두 번째 경우에는 사용자 지정 시간대를 설정하고 사용할 것입니다. HtmlSaveOptions 헤더 정보를 설정하는 데 사용됩니다.
EML에서 MHTML로 변환하기 위한 C++ 코드
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load email file | |
System::SharedPtr<MailMessage> eml = MailMessage::Load(u"SourcePath\\Message.eml"); | |
// Convert email to MHTML | |
eml->Save(u"OutputPath\\EmailToMhtml.mhtml", Aspose::Email::SaveOptions::get_DefaultMhtml()); |
MSG를 HTML로 변환하기 위한 C++ 코드
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load file | |
System::SharedPtr<MailMessage> msg = MailMessage::Load(u"SourcePath\\Message.msg"); | |
// Set the local time. | |
msg->set_TimeZoneOffset(System::TimeZone::get_CurrentTimeZone()->GetUtcOffset(System::DateTime::get_Now())); | |
// Instantiate Html Save Options | |
System::SharedPtr<HtmlSaveOptions> saveOpt = System::MakeObject<HtmlSaveOptions>(); | |
// Enable the header information | |
saveOpt->set_HtmlFormatOptions(HtmlFormatOptions::WriteHeader); | |
// Convert to HTML having header information and custome time zone | |
msg->Save(u"OutputPath\\msgToHTML.html", saveOpt); |