Skip to content

Issue with using toRecipients property in EWS restriction #251

Description

@hmsfdev

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

$restriction = [
    'And' => [
        'And' => [
            'IsEqualTo' => [
                'From' => $email_search,
            ]
        ]
    ]
];

However, when I try to use the toRecipients property in the same way, like this:

$restriction = [
    'And' => [
        'And' => [
            'IsEqualTo' => [
                'toRecipients' => $email_search,
            ]
        ]
    ]
];

. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions