php-ews
php-ews copied to clipboard
Get only mails of a folder
Hi,
I'm trying to get only mails of a folder but the following code doesn't work and I don't understand why.
$api = garethp\ews\MailAPI::withUsernameAndPassword($host, $login, $password);
$mails = $api->getMailItems($folderId,
[
'Restriction' => [
'IsEqualTo' => [
'FieldURI' => [
'FieldURI' => garethp\ews\API\Enumeration\UnindexedFieldURIType::ITEM_CLASS
],
'FieldURIOrConstant' => [
'Constant' => [
'Value' => 'IPM.Note'
]
]
]
]
]
);
Is my restriction correct?