'Create EmailMessage out of Aspose.Net Email MapiMessage?

Is there a way to create an EWS EmailMessage class instance out of Aspose.Net Email MapiMessage class instance?

I'm trying to use some common logic for email processing.

1) I have a service processing emails coming to an Exchange folder, and everything works just perfectly.

2) Also, I have users able to upload email files (*.msg) into the web app. These emails are processed using Aspose.Net.Email and I have an instance of MapiMessage as an output.

What I can try to do is to use MapiMessage .ToMailMessage() method, which will create an instance of MailMessage from this MapiMessage. But even after that, I wasn't able to find a way to create an EmailMessage to be able to use the processing logic from 1).

Any suggestions?



Solution 1:[1]

I have observed your requirements and if I am correctly understanding you are looking for support for interface between Aspose.Email MapiMesaage class and EWS EmailMesage class. These two classes belong to two different APIs and have no interface between them. Aspose.Email for .NET does allow saving as MSG or EML file format and you may load them on your end using EmailMessage class.

I am working as Support developer/ Evangelist at Aspose.

https://docs.microsoft.com/en-us/dotnet/api/microsoft.exchange.webservices.data.emailmessage?view=exchange-ews-api

https://apireference.aspose.com/net/email/aspose.email.mapi/mapimessage/constructors/1

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Wai Ha Lee