开发者

How to send mobile messages using php [duplicate]

This question already has answers here: Closed 10 years ago.

Possible Duplicate:

SMS from web ap开发者_开发百科plication

I am in need to know how to send messages from a php website or any service provider api's are there to send the message. Is there any tutorial to follow or any step by step procedure.

Thanks, Lokesh


I use a service in Australia called SMSBullet. Using their API it's as simple as requesting a URL. e.g.

<?php

$message = "This is your message";
$mobileNumber = "MOBILE-NUMBER-TO-SEND-TO";

$url = "https://www.smsbullet.com.au/msg.php?u=USERNAME&p=PASSWORD&d=".$mobileNumber."&rr=1&m=".urlencode($message);

$response = file_get_contents($url);

?>

In this example, the GET request is executed very simply using file_get_contents, you could also use CURL or fopen.

The parameters, response format etc will vary depending on which service provider you use.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜