Send SMS - messages all over the world using twilio
Note: Single class file only for sending sms - messages. Other twilio features are not included.
Requirements ¶
Yii 1.1 or above
PHP 5 above
Usage ¶
Copy the twiliosms folder into protected/extensions/
require_once('/path/to/extensions/twilio/Services/Twilio.php');
$sid = "{{ ACCOUNT SID }}"; // Your Account SID from www.twilio.com/user/account
$token = "{{ AUTH TOKEN }}"; // Your Auth Token from www.twilio.com/user/account
$client = new Services_Twilio($sid, $token);
$message = $client->account->sms_messages->create(
'+14158141829', // From a valid Twilio number
'+14159352345', // Text this number
"Hello world! This is admin, testing our twilio api"
);
Example
require_once(dirname(__FILE__) . '/../extensions/twilio/Services/Twilio.php'); $sid = ""; // Your Account SID from www.twilio.com/user/account $token = ""; // Your Auth Token from www.twilio.com/user/account $client = new Services_Twilio($sid, $token); try { $message = $client->account->sms_messages->create( '44444444444', // From a valid Twilio number $to, // Text this number $textmessage //message ); $twilioMessageResponse = $message->sid; $receiver_count++; } catch (Exception $e) { $error[$receiver_count] = $e->getMessage();
Good work
Good work!
@Nisanth thulasi
Thank you.
Nice
Thank you very much for your patience and sharing your knowledge..
@Rohit Suthar
Thank you.
Requirements?
Is there anything else other than php 5 I need to run this? Cause it works on xampp but not when I uploaded it to my host server
Error ... need update
i got this error when run
preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead
@kapous
find and replace preg_replace(): with preg_replace_callback . its about new php version.
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.