Reputation: 138
I've got a Zarafa server and I want to access the mails and calendar entries via PHP MAPI interface.
I didn't find any thing out about this solution for PHP, only for high-programming languages like C++.
Do you know a description or an example of how to implement and use the MAPI interface in PHP to communicate and get data from Zarafa server?
Upvotes: 0
Views: 927
Reputation: 138
Currently I'm able to access the calendar folder and get the standard information like subject, body and so on which are already defined, but if I want to get extras like start- or endtime or the location, they aren't in the response array. I also tried access strings like "PT_STRING8:PSETID_Appointment:0x8208", didn't work.
$contents_table = mapi_folder_getcontentstable($this->calendar);
$props = array();
// $props["entryid"] = PR_ENTRYID;
$props["subject"] = PR_SUBJECT;
$props["body"] = PR_BODY;
$props["start"] = "PT_SYSTIME:{00062002-0000-0000-C000-000000000046}:0x820d";
$props["dtstamp"] = PR_LAST_MODIFICATION_TIME;
$props["location"] = "PT_STRING8:{00062002-0000-0000-C000-000000000046}:0x8208";
/* location, start won't be displayed */
$prop_ids = getPropIdsFromStrings($this->user_store, $props);
$rows = mapi_table_queryallrows($contents_table, $prop_ids);
var_dump($rows);
so, how i'm able to read out the information where i've to write id string by myself ?
Thank you
EDIT : Got it by checking whether I'm using default store or not and I've got an programming mistake in creating instance of class where I forgot to reset the store, so store was null and mapi_getIdsfromNames returned empty array
Upvotes: 0
Reputation: 6683
You need to use php-mapi extension provided by zarafa
Take a look at below API for PHP-MAPI although it is very old one but it will give you a starting point
https://community.zarafa.com/php-ext/
Also you can clone this repo to look into some example scripts in php and python
https://github.com/zarafagroupware/zarafa-tools
Upvotes: 1