Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A Working Example Of Getting The Message Body #607

Open
GravisTechRyan opened this issue Feb 3, 2022 · 4 comments
Open

A Working Example Of Getting The Message Body #607

GravisTechRyan opened this issue Feb 3, 2022 · 4 comments

Comments

@GravisTechRyan
Copy link

I understand that in order to get the message body I need to make a second request but after spending a few hours trying to find a working example, none I've found work. Can we please get an example of how to get the message body with the correct library use clauses?

@willbonde
Copy link

@GravisTechRyan - you ever figure this out? Same issue here.

@GravisTechRyan
Copy link
Author

@willbonde I wasn't able to get this one working. I switched to this project and its works easily: https://github.com/Garethp/php-ews

@tillmannschiffler
Copy link

Same problem here - i consider switching to the mentioned lib. But maybe you guys have another idea?

@js69uk
Copy link

js69uk commented Aug 30, 2023

managed to get the email body
$request = new \jamesiarmes\PhpEws\Request\GetItemType();
$request->ItemShape = new \jamesiarmes\PhpEws\Type\ItemResponseShapeType();
$request->ItemShape->BaseShape = \jamesiarmes\PhpEws\Enumeration\DefaultShapeNamesType::ALL_PROPERTIES;
$request->ItemIds = new \jamesiarmes\PhpEws\ArrayType\NonEmptyArrayOfBaseItemIdsType();

$item = new \jamesiarmes\PhpEws\Type\ItemIdType();
$item->Id = $messageId;
$item->ChangeKey = $changeKey;
$request->ItemIds->ItemId[] = $item;

$response = $client->GetItem($request);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants