I am using php-ews for reading the exchange mailbox. However, i would like to pick an e-mail from the inbox and reply to that e-mail, with the email history and send the response. Below is the code that i am using to get the specific email from the Inbox.
$ews = new ExchangeWebServices($account_array['server'], $account_array['username'], $account_array['password'], ExchangeWebServices::VERSION_2010_SP1);
$message_id = 'AAMkADU3ZDdmZmY3LWI3OGMtNDRmMy1hYTdlLTBlZjkwOGE3NTU5MwBGAAAAAADkJRKCdlaES7sRqf3veO/UBwCgoREk6zyqQqi6KC/gJMy0AAAAvGoCAACgoREk6zyqQqi6KC/gJMy0AAAAvGpQAAA=';
$change_id = 'CQAAABYAAACgoREk6zyqQqi6KC/gJMy0AAAAvMEZ';
$request = new EWSType_GetItemType();
$request -> ItemShape = new EWSType_ItemResponseShapeType();
$request -> ItemShape -> BaseShape = EWSType_DefaultShapeNamesType::ALL_PROPERTIES;
$request -> ItemShape -> BodyType = EWSType_BodyTypeResponseType::HTML;
$body_property = new EWSType_PathToUnindexedFieldType();
$body_property -> FieldURI = 'item:Body';
$request -> ItemShape -> AdditionalProperties = new EWSType_NonEmptyArrayOfPathsToElementType();
$request -> ItemShape -> AdditionalProperties -> FieldURI = array($body_property);
$request -> ItemIds = new EWSType_NonEmptyArrayOfBaseItemIdsType();
$request -> ItemIds -> ItemId = array();
$message_item = new EWSType_ItemIdType();
$message_item -> Id = trim($message_id);
$request -> ItemIds -> ItemId[] = $message_item;
$response = $ews -> GetItem($request);
//print '<pre>' . print_r($response, true) . '</pre><hr/>';
$message = $response -> ResponseMessages -> GetItemResponseMessage -> Items -> Message;
print '<pre>' . print_r($message, true) . '</pre><hr/>';
Now that i have got the message to reply to, how do i take this further and draft a response message and create a Reply Item for this email.
I have searched Google for this, but no luck.
Drilling into the php-ews classes for hours, i took a look at EWSType_ReplyAllToItemType, EWSType_PostReplyItemType, EWSType_PostReplyItemBaseType, etc. but unable to understand how to use these codes.
Please help guys! any helps would be greatly appreciated.
I am sure that any response to this post would be helpful since there are no forums talking about this. :)
Thank You.