jamesiarmes / php-ews

PHP Exchange Web Services
http://jamesarmes.com/php-ews/
MIT License
567 stars 302 forks source link

Setting Message Flag Dates not working for Inbox message (follow up) #548

Open justbaron opened 5 years ago

justbaron commented 5 years ago

Version: 1.0, dev-master PHP version: 7.3.1 Microsoft Exchange version: VERSION_2013_SP1

When creating a message with the MessageDispositionType:

$request->MessageDisposition = MessageDispositionType::SEND_AND_SAVE_COPY;

And then setting the FlagStatus to "Flagged"

$message = new MessageType();
$message->Subject = 'EWS Inline Image';

$StartDate = new DateTime('tomorrow 3:00pm');
$DueDate = new DateTime('tomorrow 4:30pm');

$message->Flag->FlagStatus = 'Flagged';
$message->Flag->StartDate = $StartDate->format('c');
$message->Flag->DueDate = $DueDate->format('c');
.....

I get two flagged items, one in the Inbox, and the other in Sent Items.

Only the Sent Items message has the correct assigned dates.
The Inbox message flag does not accept the dates (displays as NONE)

image

If I use MessageDispositionType::SEND_ONLY;, the Inbox message dates are still not set.

enter image description here

Is there any way to only set the FlagStatus to the Inbox item instead of both; and why, if I am able to assign the flag start/due/complete dates to the message, would they only take affect on the Sent Items message and not the Inbox message?