Hi, I am evaluating Aspose.Email.
We need to be able to take an .oft (html) file, edit it,save it as a .msg and open it with Outlook.
I found sample code to do just that, which I used as basis for my test (see below).
The test opens the .oft and creates a .msg.
However, when the .msg is opened in Outlook it is loaded as a text msg (not html).
What am I doing wrong?
Dev env: VS 2010, .net v4
OS Windows: 8.1
Outlook 2010 (v 14.07.7116.5000)
I have attached an archive containing the source .oft and the generated .msg file.
It also includes a .msg (t1_outlook.msg) which was created from the .oft file using Outlook.
test code:
static void MsgFromOft(string data_dir_, string fn_)
{
var oft1_fn = fn_ + “.oft”;
var oft1_path = Path.Combine(data_dir_, oft1_fn);
var msg_fn = fn_ + “.msg”;
var msg_path = Path.Combine(data_dir_, msg_fn);
var msg = MailMessage.Load(oft1_path, MailMessageLoadOptions.DefaultMsg);
//var msg = MailMessage.Load(oft1_path, MessageFormat.Msg);
msg.To.Add(new MailAddress(“kon@mymail.net.au”, “Kon”));
var outlookMsg = MapiMessage.FromMailMessage(msg);
outlookMsg.SetMessageFlags(MapiMessageFlags.MSGFLAG_UNSENT);
outlookMsg.Save(msg_path);
System.Diagnostics.Process.Start(msg_path);
}
Hi Kon,
MapiMessage mapi = MapiMessage.FromFile(@“D:\Aspose\DataOftToMsg\t1.oft”);
mapi.Recipients.Add(“kon@mymail.net.au”, “Kon”, MapiRecipientType.MAPI_TO);
mapi.SetMessageFlags(MapiMessageFlags.MSGFLAG_UNSENT);
mapi.Save(@“D:\Aspose\DataOftToMsg\Resultant.msg”);
Hi,
thanks for the info. Your work around works.
I am very interested to see how quickly the issue is fixed.
Hi Kon,
The issues you have found earlier (filed as NETWORKNET-34357) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
Thanks, the update has fixed the issue.
Hi Kon,