从Web发送短信(是否有一些提供商)?

我想要像app.net网站那样的东西.您单击按钮并获得通过短信(或电子邮件)发送手机链接的选项.实现短信方面有哪些选择,是否有提供此功能的服务或开源软件包?

Here’s a random example from app.net .点击“获取此应用程序”按钮,看看我的意思.

这样的东西甚至可以为我工作< a href =“http://saasSMS.com?url=mycorp.com/test.html”>发送链接到Phone< / a> “saasSMS.com”是一种处理整个短信方面的服务.理想情况下,可以通过链接或通过表单发布处理(并且它会在成功时重定向回您的网站).

我不想要的东西:一个下拉菜单,让你选择你的操作符和一些试图给你发送电子邮件@phtext.com或类似的php页面.那不够光滑.

最佳答案 您可以使用
ViaNett HTTP API在全球范围内发送SMS消息,而无需指定运算符.

只要您的后端支持调用HTTP请求,它就可以工作.

这是一个用PHP编写的示例:

<?php

// Register here to get a username and password:
// http://www.vianett.com/en/free-demonstration-account

if (vianett_sendsms('username', 'password', 'example', '+4412345678', 'Hello world', $error)) {
    echo 'Success!';
} else {
    echo $error;
}

function vianett_sendsms($username, $password, $from, $to, $msg, &$response=null) {
    $url = 'https://smsc.vianett.no/v3/send.ashx';
    $data = array(
        'user'  => $username,
        'pass'  => $password,
        'src'   => $from,
        'dst'   => $to,
        'msg'   => $msg
    );
    $qs = http_build_query($data);
    $response = file_get_contents($url.'?'.$qs);
    return $response == '200|OK';
}
点赞