PHP Invoke call Textmagic API send SMS

Source: Internet
Author: User

PHP implementation of online text messaging, the need for Third-party APIs, the following code is called the Textmagic API to achieve the function of sending SMS:

View SOURCEPRINT?01

02//introduces textmagic PHP library files

03require (' textmagic-sms-api-php/textmagicapi.php ');

04$username = ' MyUserName ';

05$password = ' MyPassword ';

06$router = new Textmagicapi (Array (

The ' username ' => $username,

The ' Password ' => $password

09));

10//send a message to ' 222-345-5678 '

11$result = $router->send (' Wake up! ', Array (2223455678), true);

12//Results (Official information): Array ([messages] => array ([19896128] => 9991234567) [Sent_text] => Wake up! [Parts_count] => 1)

13?>

If there is no Textmagic API class library can be downloaded here: Textmagic-sms-api PHP send SMS Module class

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.