Created
March 17, 2023 21:21
-
-
Save wdormann/e1c649aafdb616b83e0fd508bf028255 to your computer and use it in GitHub Desktop.
Convert .MSG file to TNEF file
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Aspose.Email; | |
namespace msgtotnef | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
if (args.Length < 2) | |
{ | |
Console.WriteLine("Usage: " + System.AppDomain.CurrentDomain.FriendlyName + " <input.msg> <output.tnef>"); | |
} | |
else | |
{ | |
string inputFile = args[0]; | |
string outputFile = args[1]; | |
using (Aspose.Email.Mapi.MapiMessage mailMessage = Aspose.Email.Mapi.MapiMessage.FromFile(inputFile)) | |
{ | |
mailMessage.SaveAsTnef(outputFile); | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment