简体   繁体   中英

How can I change the time that an e-mail was received via Microsoft Exchange Server or Microsoft Outlook?

As the question says, how can I change the time that an e-mail was received either via Microsoft Outlook or via Microsoft Exchange Server (as an Administrator account) directly?

There are numerous GUI tools online that plug in to Microsoft Outlook and allow you to change various things (including the received date/time) of an e-mail, and these changes are then pushed back to the server.

My question though concerns how to do such without these shareware GUI tools that are available online ie directly through Microsoft Outlook or Microsoft Exchange Server (as an Administrator account) using PowerShell or the like.

Outlook Object Model exposes the MailItem.ReceivedTime and MailItem.SentOn properties. Unfortunately they are read-only, even though your can change these properties using Extended MAPI (C++ or Delphi only) - the properties are PR_MESSAGE_DELIVERY_TIME and PR_CLIENT_SUBMIT_TIME respectively. Worse than that, OOM has an annoying habit of updating ReceivedTime property every time MailItem.Save is called. Note that creation and last modification dates cannot be changes using any API - these values are automatically updated by the store provider.

You can manually modify PR_MESSAGE_DELIVERY_TIME and PR_CLIENT_SUBMIT_TIME properties using OutlookSpy - select the message, click the IMessage button, double click on these properties to edit them.

If using Redemption (any language) is an option, it allows to modify these properties. The following VB script will update the dates of the currently selected message in Outlook:

  TheDate = #2015/12/01 2:00 pm#
  set Session = CreateObject("Redemption.RDOSession")
  Session.MAPIOBJECT = Application.Session.MAPIOBJECT
  set Item = Session.GetMessageFromID(Application.ActiveExplorer.Selection(1).EntryID)
  Item.ReceivedTime = TheDate
  Item.SentOn = TheDate
  Item.Save

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM