Convert MapiMessage to MailMessage

Hi,

I'm working with aspose.network to create and convert Outlook messages. Unfortunately I cannot find an easy way to directly send MapiMessages loaded from a file stream. I can access all properties of it, but there's no way to send it.

Is there a simple way to send a MapiMessage without converting it to a MailMessage? If not, is there a simple way to convert a MapiMessage to a MailMessage including all its attachments, instead of passing all properties from the MapiMessage to the MailMessage?

Many thanks in advance,

Mike

Hi Mike,


Thank you for inquiry.

Please try the following code to get MailMessage instance from a MapiMessage.

MapiMessage mapiMsg = MapiMessage.FromFile(“test.msg”);
// get MailMessageInterpretor instance
MailMessageInterpretor mi = MailMessageInterpretorFactory.Instance.GetIntepretor(mapiMsg.MessageClass);

// get MailMessage instance
MailMessage message = mi.Interpret(mapiMsg);

thanks ok got it