php-ews icon indicating copy to clipboard operation
php-ews copied to clipboard

get ID of message when CreateItem MessageDisposition is SendAndSaveCopy

Open shaun-madison opened this issue 5 years ago • 1 comments

Version (e.g. 1.0, dev-master): 1.0.0 PHP version: 7.0 Microsoft Exchange version: Exchange2013_SP1

Description of problem: Unable to retrieve ItemId of message after

Example request:

$request->Items->Message[] = $message; $response = $client->CreateItem($request); $response_messages = $response->ResponseMessages->CreateItemResponseMessage; foreach ($response_messages as $response_message) { if ($response_message->ResponseClass != ResponseClassType::SUCCESS) { continue; } // Iterate over the created messages, printing the id for each. foreach ($response_message->Items->Message as $item) { $output = '- Id: ' . $item->ItemId->Id . NL; $output .= '- Change key: ' . $item->ItemId->ChangeKey . NL; echo ('Message created successfully'.NL.$output); } }

Example response: with: $request->MessageDisposition = MessageDispositionType::SAVE_ONLY;

the draft message is created and ItemId is returned as expected but with: $request->MessageDisposition = MessageDispositionType::SEND_AND_SAVE_COPY;

there is no response message to process ...?????????

Additional details: https://docs.microsoft.com/en-us/exchange/client-developer/exchange-web-services/how-to-send-email-messages-by-using-ews-in-exchange

clearly states the EWS response for :SEND_AND_SAVE_COPY does contain the ItemID of the newly sent message in the sent folder but your implementation seems to not return it - why is that?

shaun-madison avatar Jun 26 '19 10:06 shaun-madison

@shaun-madison Did you fix this issue? Could you share your workaround? I have same questions.

winds1983 avatar Nov 05 '20 10:11 winds1983