การแปลงรูปแบบอีเมลของ Outlook และ Thunderbird ผ่าน C #
Microsoft® การแปลงและวิเคราะห์ไฟล์ Outlook และ Thunderbird เพื่อสร้างแอปพลิเคชัน.NET ข้ามแพลตฟอร์ม
.NET Email API เพื่อสร้างโซลูชันการประมวลผลอีเมลข้ามแพลตฟอร์มที่มีความสามารถในการสร้างจัดการประมวลผลแปลงและส่งข้อความโดยไม่ต้องติดตั้ง Microsoft Outlook®.นักพัฒนาสามารถปรับปรุงแอปพลิเคชันได้อย่างง่ายดายสำหรับคุณลักษณะต่างๆ เช่น การเพิ่ม การรับหรือลบไฟล์แนบจากวัตถุข้อความ การปรับแต่งส่วนหัวข้อความ โดยการเปลี่ยนหัวเรื่อง การเพิ่มหรือลบผู้รับ และอื่นๆ
แปลงอีเมลเป็นรูปแบบไฟล์ต่างๆ
นักพัฒนาสามารถแปลงรูปแบบอีเมลได้อย่างง่ายดายโดยรวม API โดยไม่ต้องเข้าไปในรายละเอียดภายในของข้อมูลจำเพาะรูปแบบพื้นฐานกระบวนการแปลงเป็นเรื่องง่ายโดยการโหลดแหล่งที่มาโดยใช้ MailMessage.Load และโทรหาก วิธีการบันทึก มีไฟล์เอาต์พุตและ SaveOptions.DefaultFormat เป็นพารามิเตอร์
รหัส C # สำหรับการแปลง MSG เป็น EML
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 the Message file | |
using (var msgtoEml = MailMessage.Load(dir + "sourceFile.msg")) | |
{ | |
// save in EML format | |
msgtoEml.Save(dir + "convertedfile.eml", SaveOptions.DefaultEml); | |
} |
รหัส C # สำหรับการแปลง MSG เป็น HTML
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 the Message file | |
using (var msgtoHTML = MailMessage.Load(dir + "GetHTMLFilefrom.msg")) | |
{ | |
// save in HTML formats | |
msgtoHTML.Save(dir + "savefile.html", SaveOptions.DefaultHtml); | |
} |
รหัส C # สำหรับการแปลง MSG เป็น MHTML
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 the Message file | |
using (var msgtoMHTML = MailMessage.Load(dir + "ConvertMHTMLFilefrom.msg")) | |
{ | |
// save in MHTML format | |
msgtoMHTML.Save(dir + "output.mhtml", SaveOptions.DefaultMhtml); | |
} |