SMS/Text message sending via PHP

后端 未结 6 2286
孤独总比滥情好
孤独总比滥情好 2020-12-15 10:15

I\'m interested in knowing if it would be at all feasible to be able to send text messages via PHP. The main purpose of which would be to send a single message to a group of

相关标签:
6条回答
  • 2020-12-15 10:40

    I've done this with PHP, and it works very well. Text messages are nothing more than an email, usually with the receiver's 10 digit number @address.com. If you want to send text messages to someone with PHP, you'll need to get the proper address:

    Here is a Partial List

    You'll want to be careful with how long your messages get, since at about 55 characters (I believe) your message can be either split into multiple texts, or lost.

    Sending texts via email is free.

    0 讨论(0)
  • 2020-12-15 10:48

    I'm interested in knowing if it would be at all feasible to be able to send text messages via PHP

    Of course, it is feasible ;-)
    Everything can be done, in PHP ;-)

    For more informations, you can take a look at these questions/answers, which provide some useful informations :

    • SMS from web application
    • Send SMS from PHP
    • any good php tutorial on how to send sms to phones?

    There are several providers that you can use as gateway to send SMS ; still, probably not free (SMS are not free, after all, generally speaking) -- but costs are not that big...

    0 讨论(0)
  • 2020-12-15 10:52

    If you have your own android phone and don't want to pay for a SMS Gateway you can set up your own one.

    download SMS Gateway API (Play store) which is a free app that you can use to send and receive messages using HTTP requests. here is a PHP example from their site.

    $URL = "http://v2.smsgateway.me/API/Send/Single.php";
    
    $postdata = http_build_query(
        array(
        'Username' => "foo@bar.co.uk",
        'Password' => "password",
        'Number' => "+447791064782",
        'Message' => "Hello World!",
        )
    );
    
    $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);
    
    0 讨论(0)
  • 2020-12-15 10:52

    If this is, for example, an internal reporting application, usually the easiest way to get SMSes out to people is to use their telecom service providers' email-to-SMS gateways. This requires that said service providers have them, but the majors all do. All you do is find out the email address to send to in order to SMS to each person and use mail() or some such to send an email there.

    0 讨论(0)
  • 2020-12-15 10:52

    To be able to send text messages as in sms you will need a sms gateway, this can be setup very easily. I have created in the past an app that converts an email into an sms via php using the pear mail lib, and you can also do it the other way around where an sms is converted into an email... the only tricky part would be getting an sms gateway that provides a very friendly interface

    0 讨论(0)
  • 2020-12-15 10:57

    Zeep Mobile

    0 讨论(0)
提交回复
热议问题