相关疑难解决方法(0)

使用php中的Google Calendar API发送邀请

这是Google日历API中的新功能,写在下面的代码中,用于使用Google API发送邀请。

<?
require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata');
Zend_Loader::loadClass('Zend_Gdata_Calendar');

$setsummary="setsummary";
$setLocation="setLocation";
$event = new Google_Event();
$event->setSummary($setsummary);
$event->setLocation($setLocation);
$start_date=date();
$start = new Google_EventDateTime();
$start->setDateTime($start_date);
$event->setStart($start);
$end_date=date();
$end = new Google_EventDateTime();
$end->setDateTime($end_date);
$event->setEnd($end);
$event->sendNotifications=true;
$attendee1 = new Google_EventAttendee();
$attendee1->setEmail('xyz@gmail.com');
$attendee2 = new Google_EventAttendee();
$attendee2->setEmail('xyzx@gmail.com');
$attendees = array($attendee1,$attendee2);
$event->attendees = $attendees;      
$opt= array ("sendNotifications" => true);
$createdEvent = $cal->events->insert('********calendar id***********', $event, $opt);      
?>
Run Code Online (Sandbox Code Playgroud)

但很遗憾,它没有发送邀请。我错过了什么?我只想简单地发送邀请到xyz@gmail.com

google-calendar-api

5
推荐指数
1
解决办法
4141
查看次数

标签 统计

google-calendar-api ×1