none
EWS: How to get a delegate sent item to the sentitem folder of the account? RRS feed

  • Question

  • When i use the sendItem webservice i can use saveitemtofolder, however, this saves the message to the sent folder of the delegate.
    (I have came to understand that this is by design).

    The second approach is use createItem with saveonly, followed by sendItem without saveitemtofolder and a copyItem.
    If i wait for some time the sent item is gone (invalid item id error) and i can no longer copy it (discovered this on a real device only, testcases always worked fast enough).

    Third approach is:
    createItem, copyItem, sendItem.
    This works well, BUT (if there was none i'd not post here) the message saved in the sentitems is unread.

    My question is:
    How can i access the message-copy to mark it read?
    CopyItem does not return an ItemId (some article said it would if the message was copied between mailboxes, but it does not).
    Searching the mail by topic is not an ideal solution as people can use the same topic multiple times.
    A timestamp does not really work due to the possible delay in executing the webservices.

    Thursday, June 30, 2011 1:34 PM

Answers

  • I found a solution:

    http://social.technet.microsoft.com/Forums/en-US/exchangesvrdevelopment/thread/dd034b8c-ffa1-4ae0-9025-45fcf520c9e5

    To retrieve the Id of the saved copy of a message, you can stamp your message with a custom extended property before you send it, then after you send the message you can search for a message that has that custom extended property value in the Sent Items folder. 

    • Marked as answer by Simon Hain Thursday, June 30, 2011 1:58 PM
    Thursday, June 30, 2011 1:58 PM