Is it possible to change outlook mails?

Hello

How can I change Outlook Messages by loading them from a *.msg file, changing some properties and writing them back to a *.msg file?

The following code can't be compiled, cause the Subject property is a Readonly Property.

Aspose.Network.Outlook.MapiMessage outlookMessage = Aspose.Network.Outlook.MapiMessage.FromFile(@"c:\Temp\test.msg");
outlookMessage.Subject = "My new Subject";
outlookMessage.Save(@"c:\Temp\testOutput.msg");

I can't convert the MapiMessage to a MailMessage, cause I don't want to loose the BodyRtf of the original Mail.

Please help me, thank you very much!
Kind Regards,
Christian Broennimann

Hi,

Thanks for considering Aspose.

We are looking into the possibility of editting properties of an msg file. Currently we support creating msg files from the MailMessage class, saving msg files and deleting attachments.

Hello again

We're now able to read a MSG Outlook file, change some data and write it back as a MSG Outlook file. We use the autoconvert (RTF-->HTML-->RTF) of Aspose.Network.Mail.MailMessage, which works fine and does not destroy the RTF layout.

But one important feature, that we need, is not (yet) supported by Aspose.Network:

When the source MSG file is an unsent mail template (Send Button enabled, Adress fields editable), the generated/converted MSG mail should be a sendable and editable mail too!

At the moment Aspose.Network writes a readonly mail.

Please implement this important feature and we'll be happy with Aspose.Network!

Thank you for your reply!
Kind Regards,

Christian Broennimann

Hello,

Thanks for your considering Aspose.

Our developers are working on this feature. We will try to provide some hotfix or beta to you ASAP.

Cheers,

Hello,

We just added the message flag set function to MaipMessage. You can try this code to make the message file is unsent status. Please check it out.

MapiMessage msg = MapiMessage.FromFile(@"test.msg");

msg.SetMessageFlags(MapiMessageFlags.MSGFLAG_UNSENT | MapiMessageFlags.MSGFLAG_FROMME);
msg.Save(@"savetounsent.msg");

Hello

Thank you very much for this quick implementation. It works as expected!

Kid Regards,
Christian Broennimann