-1

I am trying to restore (backup up email as .eml file) email to app user's Inbox or any user defined mail folder with admin authentication. Facing following problems.

  1. I am able to import .eml file using EWS managed API, but it doesn't shows actual date/time of email, instead it shows date/time when I have uploaded.
  2. I have to use Native client application to use OAuth with EWS, Is there any way to use Web App with EWS.

  3. There is one more way to download data, Microsoft Graph API. Is there any way if I can use MS Graph API for import email. Outlook Mail REST API is used for backup emails, there is no API listed for restore here.

Mahesh Mankar
  • 231
  • 3
  • 16

2 Answers2

0

I am able to import .eml file using EWS managed API, but it doesn't shows actual date/time of email, instead it shows date/time when I have uploaded.

Yes, since when importing the file , EWS will create a new message item .The created time of the email will be the current time of server .

I have to use Native client application to use OAuth with EWS, Is there any way to use Web App with EWS.

Yes , and as @Glen Scales said in your previous post, try to use below endpoint for O365 :

service.Url = new Uri("https://outlook.office365.com/EWS/Exchange.asmx");

Is there any way if I can use MS Graph API for import email.

AFAIK, currently ,Microsoft Graph Api doesn't support that . You could use an app to read the content/attributes of the eml file and create the new message via api (Graph api/outlook mail rest api).But the create time of the new message will also be the current time of server.

Community
  • 1
  • 1
Nan Yu
  • 26,101
  • 9
  • 68
  • 148
  • Thanks @nan-yu. Create mail doesn't allow me to set 'Received Time' of message, so I am using import. As this is restore, It is expected that email should show it's 'Received Time' as original received time. In my case it shows current time of server. It's acceptable if creation time doesn't reflected as original. – Mahesh Mankar May 03 '16 at 10:58
  • by using SetExtendedProperty you can able to set delivery time zone email.SetExtendedProperty(new ExtendedPropertyDefinition(3590, MapiPropertyType.SystemTime), imp.datetime); – arun Apr 11 '18 at 13:40
0

No, Microsoft Graph API doesn't have an API to restore an email back into a user's mailbox. At this point, there are no plans to add this functionality. Take a look at How to: Import items by using EWS in Exchange to see if this meet your needs.

Venkat Ayyadevara - MSFT
  • 2,850
  • 1
  • 14
  • 11