C#によるOutlookとサンダーバードの電子メール形式の変換
Microsoft® Outlook と Thunderbird のファイルの変換と解析によるクロスプラットフォームの.NET アプリケーションの構築
.NET Email API を使用すると、Microsoft Outlook をインストールしなくてもメッセージを生成、操作、処理、変換、および送信できるクロスプラットフォームのメール処理ソリューションを構築できます®。開発者は、メッセージオブジェクトの添付ファイルの追加、添付ファイルの取得または削除、件名の変更によるメッセージヘッダーのカスタマイズ、受信者の追加と削除などの機能を簡単に拡張できます。
メールをさまざまなファイル形式に変換
開発者は、基礎となる形式仕様の内部詳細を調べなくても、APIを統合することで電子メール形式を簡単に変換できます。変換プロセスは、最初に以下を使用してソースをロードするだけで簡単です。 MailMessage.Load そして電話する 保存方法 出力ファイルと SaveOptions.DefaultFormat パラメータとして。
MSG から EML への変換のための 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 the Message file | |
using (var msgtoEml = MailMessage.Load(dir + "sourceFile.msg")) | |
{ | |
// save in EML format | |
msgtoEml.Save(dir + "convertedfile.eml", SaveOptions.DefaultEml); | |
} |
メッセージを 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 the Message file | |
using (var msgtoHTML = MailMessage.Load(dir + "GetHTMLFilefrom.msg")) | |
{ | |
// save in HTML formats | |
msgtoHTML.Save(dir + "savefile.html", SaveOptions.DefaultHtml); | |
} |
MSG から 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 the Message file | |
using (var msgtoMHTML = MailMessage.Load(dir + "ConvertMHTMLFilefrom.msg")) | |
{ | |
// save in MHTML format | |
msgtoMHTML.Save(dir + "output.mhtml", SaveOptions.DefaultMhtml); | |
} |