php - PHPEWS create event on public calendar -


i'm attempting plug php based calendar management system exchange 2007 calendars.

i have below code setup @ present.

$subject = 'appointment ..';          $request = new ewstype_createitemtype();         $request->items = new ewstype_nonemptyarrayofallitemstype();         $request->items->calendaritem = new ewstype_calendaritemtype();          $request->items->calendaritem->subject = $subject;          $date1 = new datetime('2015-05-10t15:00:00+03:00');         $datestart = $date1->format('y-m-d h:i:00');         $date = new datetime($datestart);         $request->items->calendaritem->start = $date->format('c');         $date1 = new datetime('2015-05-10t17:00:00+03:00');         $dateend = $date1->format('y-m-d h:i:00');         $date = new datetime($dateend);         $request->items->calendaritem->end = $date->format('c');          $request->items->calendaritem->reminderisset = false;          $request->items->calendaritem->reminderminutesbeforestart = 15;          $request->items->calendaritem->body = new ewstype_bodytype();         $request->items->calendaritem->body->bodytype = ewstype_bodytypetype::html;  $request->items->calendaritem->body->_ = <<<eod      <p><strong>staff attending</strong>:bob</p>  eod;          $request->items->calendaritem->itemclass = new ewstype_itemclasstype();         $request->items->calendaritem->itemclass->_ = ewstype_itemclasstype::appointment;          $request->items->calendaritem->sensitivity = new ewstype_sensitivitychoicestype();         $request->items->calendaritem->sensitivity->_ = ewstype_sensitivitychoicestype::normal;          $request->items->calendaritem->categories = new ewstype_arrayofstringstype();         $request->items->calendaritem->categories->string = array(             'client meeting (scheduled)'         );          $request->items->calendaritem->location = "showroom";          $request->sendmeetinginvitations = ewstype_calendaritemcreateordeleteoperationtype::send_only_to_all;         $request->items->calendaritem->requiredattendees->attendee[0]->mailbox->emailaddress = "user@domain.com";         $request->items->calendaritem->requiredattendees->attendee[0]->mailbox->routingtype  = 'smtp';         $n = 1;           $response      = $ews->createitem($request); 

this setup event in users personal calendar fine, need post public folder calendar have folderid for.

if assist appreciated!

try adding line:

        $request->saveditemfolderid->folderid->id=$folder_id; 

after $request = new ewstype_createitemtype();

where $folder_id stupidly long microsoft folder id!!!!


Comments