Open gtorassa opened 7 years ago
Based on examples/folder/find.php
:
$parent = new DistinguishedFolderIdType();
$parent->Id = DistinguishedFolderIdNameType::ROOT;
// New Properties:
$parent->Mailbox = new StdClass;
$parent->Mailbox->EmailAddress = 'secondMailAdress@yourDomain.org';
// End of new Props.
$request->ParentFolderIds->DistinguishedFolderId[] = $parent;
Works like a charme for me; also inside Office 365...
PS (edit): DistinguishedFolderId
is an array - your code tries to access it like an object. So as a quickfix you can try (after setting DistinguishedFolderId
)
- $request->ParentFolderIds->DistinguishedFolderId->Mailbox = new StdClass;
+ $request->ParentFolderIds->DistinguishedFolderId[0]->Mailbox = new StdClass;
- $request->ParentFolderIds->DistinguishedFolderId->Mailbox->EmailAddress = 'email@address.com';
+ $request->ParentFolderIds->DistinguishedFolderId[0]->Mailbox->EmailAddress = 'email@address.com';
Hey guys,
thanks for the example - worked like a charm. I am connecting with some sort of company admin account and reading another calendar entries worked but now i am trying desperately to write into another calendar. My first ideas was like this:
$parent = new DistinguishedFolderIdType();
$parent->Id = DistinguishedFolderIdNameType::CALENDAR;
$parent->Mailbox = new StdClass;
$parent->Mailbox->EmailAddress = 'myClientAccount@somedomain.xyz';
$request->ParentFolderId = $parent;
But all i got is the event is stored into the "admin" account and not into myClientAccount.
Maybe someone can give me a hint...or example?
Version (e.g. 1.0, dev-master): 1.0.0 PHP version: 5.5.9 Microsoft Exchange version: 2016
Description of problem: How can I access to different mailboxes associated to the same Exchange user? I can easily access to my INBOX (related to my personal account) but the FindFolders doesn't provide other mailboxes associated to my account.
Example request:
I found the followinf example in C and I think it could solve the problem, so I need to tranlsate it in PHP with the php-ews library:
Example response:
N.A.
Additional details:
I found a similar issue on Stackoverflow (http://stackoverflow.com/questions/25275060/access-another-mailbox-calendar-events-with-php-ews)
but it doesn't work because the DistinguishedFolderId class doesn't have a Mailbox child class.