Garethp / php-ews

PHP Exchange Web Services
BSD 3-Clause "New" or "Revised" License
112 stars 45 forks source link

Message ID only to fetch Message #184

Closed tom-lp-at closed 4 years ago

tom-lp-at commented 4 years ago

Dear Garethp, in issue #182 we talked about the single message ID to get a message. I try it now and the result is as expected : it didn´t work :( I try it with

$this->api->getItem($message_id);

and with

$this->api->getItem(["id" => $message_id]);

but the Response is:

Type: garethp\ews\API\Exception\ExchangeException

Message: Id must be non-empty.

Filename: /home/tom/entwicklung/Protokoll/vendor/garethp/php-ews/src/API/ExchangeWebServices.php

Line Number: 417

The Log say´s :

INFO - 2019-11-20 18:46:04 --> The ID is : AAMkADMyMzQ5MDQyLWEyMjffffffggggggggggg1ZDQ5NDY5YTY3NgBGAAAAAABX1cyAvHCMTbY4Svpa5MrsBwA4UPoKc/6QSI4Mly+7Dw/EAAAAAAEMAAA4UPoKc/6QSI4Mly+7Dw/EAAB5Eu+8AAA=
ERROR - 2019-11-20 18:46:04 --> Severity: error --> Exception: Id must be non-empty. /home/tom/entwicklung/Protokoll/
vendor/garethp/php-ews/src/API/ExchangeWebServices.php 417

any glue what i miss ? (in the ID above i changed only a view Character :) ) kr Tom

Garethp commented 4 years ago

What does $message_id look like. When you var_dump($message_id);, what do you get?

tom-lp-at commented 4 years ago

The log_message "The ID is :" prints out the ID-String. but .... I think i found it in a other post with a other topic :) this looks like the right way to get a message only with the ID:

$mail = $api->getItem(new API\Type\ItemIdType($data['id']));`

could it be the correct way ? kr Tom

Garethp commented 4 years ago

Yup, that would be how you do it. Does it work for you?

tom-lp-at commented 4 years ago

YES - it work like a charm - sorry to bother you... I must train myself on passing parameters as instances ;) thx again for your time & kr Tom