I am trying to read the calendar appointments from a shared mailbox in Office365, in particular the appointment dates.
I am able to open the mailbox, and output its contents with the following code
$con = "{outlook.office365.com:993/imap/ssl/readonly}";
$mbox = imap_open($con."Calendar", "{emailaddress}\{sharedmailbox}", "{password}");
$search = '';
$emails = imap_search($mbox,$search);
foreach($emails as $email){
$body = imap_fetchbody($mbox,$email,1);
echo"<pre>";print_r($body);echo"</pre>";
}
This outputs the following:
The server couldn't retrieve the following message:
Subject: "{subject}"
From: "{User name}")
Sent date: {Date the appointment invite was sent}
The message hasn't been deleted. You might be able to view it using either =
Outlook or Outlook Web App. You can also contact the sender to find out wha=
t the message says.=
I need it to get the date of the appointment itself, not just the date the appointment invite was sent.
Any help would be appreciated, Thanks.