คำถามที่พบบ่อย — Aspose.Email FOSS for C++
การให้สิทธิ์
Aspose.Email FOSS for C++ ใช้ใบอนุญาตอะไร?
สัญญาอนุญาต MIT. ไม่จำเป็นต้องใช้คีย์ใบอนุญาต. ใช้ได้อย่างอิสระในโครงการส่วนบุคคล, เชิงพาณิชย์, และโอเพ่นซอร์ส
โครงการ. ข้อผูกมัดเดียวคือการใส่ประกาศลิขสิทธิ์และข้อความสัญญาอนุญาตในสำเนา
ของซอฟต์แวร์.
ฉันสามารถใช้ในผลิตภัณฑ์เชิงพาณิชย์ได้หรือไม่?
ใช่. ใบอนุญาต MIT อนุญาตให้ใช้เชิงพาณิชย์โดยไม่มีข้อจำกัด รวมถึงการฝังในแอปพลิเคชันที่เป็นกรรมสิทธิ์โดยไม่มีค่าลิขสิทธิ์.
การติดตั้ง
ฉันจะติดตั้ง Aspose.Email FOSS สำหรับ C++ อย่างไร?
โคลนรีโพสิตอรีและเพิ่มเป็นไดเรกทอรีย่อยของ 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 aspose_email_foss)คอมไพเลอร์เวอร์ชันใดที่รองรับ?
คอมไพเลอร์ C++17 ใดก็ได้: GCC 9+, Clang 10+, หรือ MSVC 2019+. ไลบรารีสามารถสร้างบน Windows, Linux, และ macOS.
มีการพึ่งพาภายนอกหรือไม่?
ไม่. ไลบรารีไม่มีการพึ่งพาภายนอกเลย. มันใช้เฉพาะไลบรารีมาตรฐานของ C++ เท่านั้น.
การสนับสนุนรูปแบบ
รูปแบบอีเมลที่รองรับมีอะไรบ้าง?
| Format | Read | Write |
|---|---|---|
| MSG (Outlook Message) | ใช่ | ใช่ |
| EML (RFC 5322 / MIME) | ใช่ | ใช่ |
| CFB (Compound File Binary) | ใช่ | ใช่ |
ฉันสามารถแปลงระหว่าง MSG และ EML ได้หรือไม่?
ใช่ โหลดไฟล์ EML ด้วย mapi_message::load_from_eml() และบันทึกเป็น MSG ด้วยmapi_message::save(). แปลงในทิศทางตรงกันข้ามด้วย mapi_message::from_file()
ตามด้วย save_to_eml().
การใช้ API
ฉันจะอ่านไฟล์ MSG อย่างไร?
ใช้ mapi_message::from_file() หรือ 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';
}ฉันจะสร้างไฟล์ MSG ใหม่จากศูนย์อย่างไร?
ใช้ mapi_message::create() เพื่อสร้างข้อความ ตั้งค่าฟิลด์ และบันทึก:
#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);
}ฉันจะเข้าถึงคอนเทนเนอร์ CFB ระดับต่ำได้อย่างไร?
ใช้ cfb_reader เพื่อเปิดไฟล์ CFB และสำรวจโครงสร้างไดเรกทอรีของมัน:
#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();คุณยังสามารถนำทางโดยใช้เส้นทางด้วย resolve_path() หรือค้นหา child ตามชื่อด้วย find_child_by_name().
ฉันจะเขียนไฟล์ CFB อย่างไร?
สร้าง cfb_document, เพิ่ม storages และ streams, แล้ว serialize ด้วย 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");ข้อจำกัดที่ทราบ
ไลบรารีนี้รองรับ IMAP, SMTP หรือ POP3 หรือไม่?
ไม่ใช่. Aspose.Email FOSS for C++ อ่านและเขียนไฟล์ในเครื่องเท่านั้น. มันไม่เชื่อมต่อกับ เซิร์ฟเวอร์เมล
รองรับ TNEF (winmail.dat) หรือไม่?
ไม่. Transport Neutral Encapsulation Format ไม่ได้ถูกแยกวิเคราะห์หรือสร้างขึ้น
มี API ปฏิทินหรือการนัดหมายหรือไม่?
ไม่. คุณสมบัติ MAPI ที่เฉพาะเจาะจงสำหรับปฏิทินสามารถเข้าถึงได้โดยทั่วไปผ่านวิธีการของคุณสมบัติ, แต่ไม่มี API ปฏิทินเฉพาะ.
เวอร์ชันการปล่อยปัจจุบันคืออะไร?
Version 0.1.0 — การปล่อยสาธารณะครั้งแรก. API อาจพัฒนาในเวอร์ชันต่อไป.