Open hmsfdev opened 1 year ago
I've never used restrictions with EWS, but maybe the error is that you need to use 'ToRecipients' instead of 'toRecipients' as you can see on this documentation :
$restriction = [
'And' => [
'And' => [
'IsEqualTo' => [
'ToRecipients' => array('X@mail.com', 'Y@mail.com'), //Or your array $email_search
]
]
]
];
Or maybe something like that :
$restriction = [
'And' => [
'IsEqualTo' => [
'ToRecipients' => array('X@mail.com', 'Y@mail.com'), //Or your array $email_search
]
]
];
I've never used restrictions with EWS, but maybe the error is that you need to use 'ToRecipients' instead of 'toRecipients' as you can see on this documentation :
$restriction = [ 'And' => [ 'And' => [ 'IsEqualTo' => [ 'ToRecipients' => array('X@mail.com', 'Y@mail.com'), //Or your array $email_search ] ] ] ];
Or maybe something like that :
$restriction = [ 'And' => [ 'IsEqualTo' => [ 'ToRecipients' => array('X@mail.com', 'Y@mail.com'), //Or your array $email_search ] ] ];
Hello
thanks you for helping , but this code give me Array to string conversion..
I am currently working with Exchange Web Services (EWS) in PHP and I have encountered an issue with using the toRecipients property in the restriction. I have successfully used other properties such as From in the restriction and it works fine. However, when I try to use the toRecipients property, I receive the following error message: "An error occurred: The property can not be used with this type of restriction."
Here is an example of the working restriction using the From property
However, when I try to use the toRecipients property in the same way, like this:
. I even tried putting $email_search in an array, but I encounter the error: "Array to string conversion"
I have searched for a solution but haven't found any specific information on using the toRecipients property in EWS restrictions. I would greatly appreciate any guidance or insights on how to properly use the toRecipients property in the restriction.
Thank you in advance for your help.