 |
อยากสอบถามเรื่อง google calendar ในการส่ง sms ได้ทีละหลายๆเบอร์ |
|
 |
|
|
 |
 |
|
ผมใช้ code ด้านล่างในการส่ง sms ตอนนี้ มันส่งได้เบอร์เดียวแต่ผมต้องการให้มันส่งได้หลายๆเบอร์ ไม่ทราบว่าต้องเขียน code เพิ่มยังไงครับ รบกวนผู้ที่มีความชำนาญ ความรู้ในเรื่องนี้ตอบผมทีน่ะครับ
Code (PHP)
<?
function send_sms( $param_google_username , $param_google_password,$param_title,$param_content ){
/**
* @Include Zend_Loader
*/
require_once 'Zend/Loader.php';
/**
* @Load Zend_Gdata
*/
Zend_Loader::loadClass('Zend_Gdata');
/**
* @Load Zend_Gdata_AuthSub
*/
Zend_Loader::loadClass('Zend_Gdata_AuthSub');
/**
* @Load Zend_Gdata_ClientLogin
*/
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
/**
* @Load Zend_Gdata_HttpClient
*/
Zend_Loader::loadClass('Zend_Gdata_HttpClient');
/**
* @Load Zend_Gdata_Calendar
*/
Zend_Loader::loadClass('Zend_Gdata_Calendar');
// Parameters for ClientAuth authentication
$service = Zend_Gdata_Calendar::AUTH_SERVICE_NAME;
$user = $param_google_username ;
$pass =$param_google_password ;
// Create an authenticated HTTP client
$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $service);
// Create an instance of the Calendar service
$service = new Zend_Gdata_Calendar($client);
// Create a new entry using the calendar service's magic factory method
$event= $service->newEventEntry();
// Populate the event with the desired information
// Note that each attribute is crated as an instance of a matching class
$event->title = $service->newTitle( $param_title );
//$event->where = array($service->newWhere("Mountain View, California"));
$event->content = $service->newContent( $param_content );
// Set the date using RFC 3339 format.
$startDate = date( "Y-m-d" );//"2009-01-15";
$startTime = date( "H:i" , strtotime("+3 minutes") );
$endDate = date( "Y-m-d" );
$endTime = date( "H:i" , strtotime("+6 minutes") );
$tzOffset = "+07";
$when = $service->newWhen();
$when->startTime = "{$startDate}T{$startTime}:00.000{$tzOffset}:00";
$when->endTime = "{$endDate}T{$endTime}:00.000{$tzOffset}:00";
// Create a new reminder object. It should be set to send an email
// to the user 10 minutes beforehand.
$reminder = $service->newReminder();
$reminder->method = "sms";
$reminder->minutes = "2";
$when->reminders = array($reminder);
$event->when = array($when);
// Upload the event to the calendar server
// A copy of the event as it is recorded on the server is returned
if ($newEvent = $service->insertEvent($event)){
return true ;
}else{
return false;
}
}
$google_username = "[email protected]"; // username เข้ากูเกิลของคุณ
$google_password = "golfkung"; // password เข้ากูเกิลของคุณ
$title = "แจ้งปัญหาการใช้งาน";
// ส่ง SMS
send_sms( $google_username , $google_password , $title ,$content );
?>
Tag : PHP
|
|
 |
 |
 |
 |
Date :
2011-02-08 16:11:30 |
By :
chonburi f.c |
View :
1509 |
Reply :
4 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
88.$google_username = "[email protected]"; // username เข้ากูเกิลของคุณ
89.$google_password = "golfkung"; // password เข้ากูเกิลของคุณ
90.$title = "แจ้งปัญหาการใช้งาน";
91.
92.
93.// ส่ง SMS
94.send_sms( $google_username , $google_password , $title ,$content );
เพิ่ม user name password อีก ตามจำนวนที่ต้องการส่ง
อย่าคิดว่าของฟรีจะทำได้ดีกว่าของเสียเงิน
|
 |
 |
 |
 |
Date :
2011-02-08 17:40:25 |
By :
... |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ไม่ได้อะครับ มัน error มีใครพอทราบอีกไหมครับช่วยผมดูที
|
 |
 |
 |
 |
Date :
2011-02-10 15:43:55 |
By :
chonburi f.c |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แค่เรียกซ้ำอีกครั้งแต่เปลี่ยน username password มันจะไป error ได้ไง
หลักการก็คือคุณต้องไปสมัครสมาชิกใหม่ แล้วตั้ง sms ใหม่อีกเบอร์
พอจะมองออกหรือยังว่ามันไม่ได้ทำอะไรได้ตามใจชอบอย่างที่คิด จะส่งให้คน 1000 คนก็ต้องสมัครสมาชิก google 1000 ครั้ง..
|
 |
 |
 |
 |
Date :
2011-02-10 16:18:29 |
By :
.. |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
มันไม่ได้ erro หรอกครับเพียงแต่ว่ามันจะส่งให้กับ acount คนสุดท้าย ไม่ใช่ส่งหมดเลย
|
 |
 |
 |
 |
Date :
2011-02-11 10:45:30 |
By :
chonburi f.c |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|