تحويل تنسيقات البريد الإلكتروني في 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); | |
} |