2013-09-24 92 views
4

我对我最后一年的项目感兴趣,我想通过PHP发送短信给客户端。通过PHP发送短信

有什么方法可以将我的手机用作GSM调制解调器并通过php发送短信?

我试过“Ozeki NG - 短信网关”,但不知道如何通过PHP发送短信。

如果有人使用/试过“Ozeki NG - 短信网关”,那么请让我知道如何正确使用它?

任何建议请让我知道。

我有一台诺基亚701,它可以用作一个GSM调制解调器吗?

谢谢

+1

检查是否这可以帮助你:http://net.tutsplus.com/tutorials/php/how-to-send-text-messages-with-php/ –

+0

我试过这个,但没有工作 – Akshay

+0

[检查此](http://www.twilio.com/)和[this](http://smsgateway.riaforge.org/)。 –

回答

1

美国电信公司让你发送短信作为电子邮件。我还没有玩过这么多年,但我记得Verizon是[Phone #]@vtext.com,其中[Phone #]是手机的10位数电话号码。您可以查找不同的电信公司域。所有这一切都是免费的,而不是按每条短信付费。

1

如果您的手机是Android的,你可以使用一个应用程序,例如SMS Gateway API将手机变成一个短信网关,并允许你可通过PHP发送和接收消息。

$URL = "http://v2.smsgateway.me/API/Send/Single.php"; 

$postdata = http_build_query(
    array(
    'Username' => "[email protected]", 
    'Password' => "password", 
    'Number' => "+447791064782", 
    'Message' => "Hello World!", 
    'Device' => 1, //Send from device 1 (optional) 
    'SendAt' => (time() + (60 * 60)), //Send in 1 hours time (optional) 
    'ExpireAt' => (time() + (60 * 60 * 2)) //Expire in 2 hours time (optional) 
    ) 
); 

$opts = array('http' => array('method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => $postdata)); 

$context = stream_context_create($opts); 

$result = file_get_contents($URL, false, $context); 

echo $result;