ASPOSE.Network does a very good job parsing Outlook’s TNEF messages, like the one attached.
From: "test"
To: "test"
Subject: z.gif
Date: Thu, 14 Oct 2010 12:21:55 -0400
Message-ID: <000101cb6bbb$eb2136f0$c163a4d0$@net>
MIME-Version: 1.0
Content-Type: application/ms-tnef; name="winmail.dat"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="winmail.dat"
X-Mailer: Microsoft Office Outlook 12.0
Thread-Index: Actru+sJCYJ5Vm4pTGq7GnlwbBDlHA==
Content-Language: en-us
X-MS-TNEF-Correlator: 0000000007BA1D8E444D804495DF3F6782C71C5904082000
X-OlkEid: 59040820F0DF731919167346BE5E04EF7C4F6531
eJ8+IjcQAQaQCAAEAAAAAAABAAEAAQeQBgAIAAAA5AQAAAAAAADoAAEIgAcAFQAAAElQTS5Eb2N1
...
sjI=
My task is opposite: to compose a TNEF message from a single original file (image, Office document, PDF, etc.). Outlook has a weird but very user friendly way of presenting those.
Is there a simple way to do it with your package? Do you have any relevant samples?
Hello,
Thank you for inquiry.
I am afraid TNEF messages cannot be created currently. I have added a new feature request in our issue tracking system for this (ID: 20787). We will consider adding it in future and will inform you when it will become available.
The issues you have found earlier (filed as NETWORKNET-20787) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.
Hi Alexander,
Thank you for your patience.
Please check the below source code to create a TNEF message,
C#
// Load an existing message in MapiMessage instance
MapiMessage msg = MapiMessage.FromFile(“OutlookMessage.msg”);
MemoryStream ms =
new MemoryStream();
// Save the MapiMessage instance to MemoryStream in TNEF format
msg.SaveAsTnef(ms);
// Create a new intance of MailMessage
MailMessage eml =
new MailMessage(
"test@test.com",
"test@test.com");
// Add the TNEF attachment
eml.AddAttachment(
new Attachment(ms, “winmail.dat”, “application/ms-tnef”));
// Save the message in EML format
eml.Save(“TnefEmail.eml”, MailMessageSaveType.EmlFormat);
Regards,