PHP Text Messaging Script

20 replies
I'm looking for a PHP script that will allow me to send automated text messages to my subscriber list. Does anyone here know of, or have experience with, a script that can do this?
#messaging #php #script #text
  • Profile picture of the author Michael Mayo
    [DELETED]
    {{ DiscussionBoard.errors[59123].message }}
    • Profile picture of the author IMLegacy
      I'm talking about mobile phone text messaging - MMS/SMS.

      I want to send text messages to cell phones... Like an email autoresponder, but texting instead.
      {{ DiscussionBoard.errors[59286].message }}
      • Profile picture of the author fredhopkins
        Here is a service that I just started playing with, Tagga (not an aff link)
        Signature
        Coming soon to a theater near you. . .
        {{ DiscussionBoard.errors[59460].message }}
  • Profile picture of the author TheRichJerksNet
    There are services you can go through but you 1 - do have to pay 2 - have limited control. If you are looking for something that you have full control over it can be coded but it is going to cost a good amount of money.

    James
    {{ DiscussionBoard.errors[59663].message }}
    • Profile picture of the author jallen001
      If you don't want to pay for services, you can email the text message to their phone. All the major carriers have email alternatives along the lines of 555555555@mobile.att.net

      You would just need a script to ask them what carrier they have when you get their number and use it to build the email address. Check each carrier to see what the email format is. It will come across as text message, not an email.
      Signature

      SecretWebStash.com - Warriors-only downloads. Use RSVP code "Warriors".
      Register first, then while you are still logged in, paste into address bar: "http://www.secretwebstash.com/Default.aspx?rsvp=Warriors"

      www.pdmwebsolutions.com Web Hosting & Website Design - Riverside, CA

      {{ DiscussionBoard.errors[74953].message }}
      • Profile picture of the author Neil Morgan
        I've been doing this for ages with my own PHP code.

        It's not difficult because providers of SMS bulk messaging often have an API than you can tie into. They usually provide examples in PHP etc.

        I'm in the UK so it's probably not relevant which one I use. But do a search in for bulk SMS messaging services and check if they have an API.

        It's actually VERY easy to do.

        Cheers,

        Neil
        Signature

        Easy email marketing automation without moving your lists.

        {{ DiscussionBoard.errors[81912].message }}
      • Profile picture of the author rwil02
        Originally Posted by jallen001 View Post

        If you don't want to pay for services, you can email the text message to their phone. All the major carriers have email alternatives along the lines of 555555555@mobile.att.net

        You would just need a script to ask them what carrier they have when you get their number and use it to build the email address. Check each carrier to see what the email format is. It will come across as text message, not an email.
        That generally won't work.

        As an example, in NZ, with Vodafone as a provider, you can send to Number@txtmail.co.nz
        HOWEVER, you have to register to use the service, and it only accepts the emails from a specified email address, and you get billed for it.

        It doesn't care what the recipient carrier is, another example is that we use RedCoal or RedSack (been a while since we set it up) which is a UK web service to send to NZ phones.
        Signature

        Roger Willcocks
        L-Space Design
        Please vote to help me win a 3kW solar array

        {{ DiscussionBoard.errors[87302].message }}
  • Profile picture of the author yangyang
    Well it might not be possible if you can't find a service provider that would come in contract with you. Or if you could find any site that already offers such service.
    Signature

    1. Global Movies Database = $489.95 = 1.5 GB data + 65.9 GB images.

    2. World Hotels Database = $589.95 = 1.54 GB data + 71.4 GB images.

    3. Auto Parts Database = $489.95 = 15.8 GB data + 30.4 GB images.

    {{ DiscussionBoard.errors[379881].message }}
  • Profile picture of the author Shadi
    actually, you can simple do a simple php script to do that but only for providers that allow sms emailing, some countries doesnt have that and for this you might want to subscribe to an sms provider.

    Other methods are using services linke wanga that has a mass sms feature
    {{ DiscussionBoard.errors[380062].message }}
  • Profile picture of the author Darren Mothersele
    Getting a PHP script to send an SMS message is not actually much harder than sending an email because you're basically doing the same thing, except rather than use an email server you use an SMS gateway.

    You need to pay for access to an SMS gateway. There are many options as a quick Google search will show you.

    Clickatell is a popular choice. They have an API so you can send messages directly from your scripts, and (like many of the other services) have code examples to get you started.
    Signature
    {{ DiscussionBoard.errors[380374].message }}
  • Profile picture of the author indianbill007
    I was wondering , where I can buy a script like this -txtin .com
    {{ DiscussionBoard.errors[2191063].message }}
  • Profile picture of the author satterthwaite
    Php is not compiled therefore it does not need to be "converted" to a text file!
    It is exactly the same as a text file in the way in which its data is stored, therefore it can be opened with a text editor.
    {{ DiscussionBoard.errors[2192732].message }}
  • Profile picture of the author tks
    Try SMS channels - Google Labs. This may be country specific. Your feed can be easily integrated with this.
    {{ DiscussionBoard.errors[2192765].message }}
  • Profile picture of the author hamishmarshal
    Here is a PHP script that you can use to send an messages: by this, just take a look at,

    <?php
    function PostToHost($host, $port, $username, $password, $data_to_send)
    {
    $dc = 0;
    $bo ="-----------------------------305242850528394";
    $fp = fsockopen($host, $port, $errno, $errstr);
    if (!$fp) {
    echo "errno: $errno \n";
    echo "errstr: $errstr\n";
    return $result;
    }
    fputs($fp, "POST / HTTP/1.1\r\n");
    if ($username != "") {
    $auth = $username . ":" . $password;
    echo "auth: $auth\n";
    $auth = base64_encode($auth);
    echo "auth: $auth\n";
    fwrite($fp, "Authorization: Basic " . $auth . "\r\n");
    }
    fputs($fp, "User-Agent: NowSMS PHP Script\r\n");
    fputs($fp, "Accept: */*\r\n");
    fputs($fp, "Content-type: multipart/form-data; boundary=$bo\r\n");
    foreach($data_to_send as $key=>$val) {
    $ds =sprintf("%s\r\nContent-Disposition: form-data; name=\"%s\"\r\n%s\r\n",$bo,$key,$val);
    $dc += strlen($ds);
    }
    $dc += strlen($bo)+3;
    fputs($fp, "Content-length: $dc\r\n");
    fputs($fp, "\r\n");
    fputs($fp, "This is a MIME message\r\n\r\n");
    foreach($data_to_send as $key=>$val) {
    $ds =sprintf("%s\r\nContent-Disposition: form-data; name=\"%s\"\r\n%s\r\n",$bo,$key,$val);
    fputs($fp, $ds );
    }
    $ds = $bo."--\r\n" ;
    fputs($fp, $ds);
    $res = "";
    while(!feof($fp)) {
    $res .= fread($fp,1);
    }
    fclose($fp);
    return $res;
    }
    $file1="C:\\TEMP\\logo.gif";
    $contenttype1 = "image/gif";
    $fa = @file($file1);
    $xf ="Content-Type: ".$contenttype1."\r\n\r\n".implode("",$fa);
    $data["MMSFile\"; filename=\"$file1"] = $xf;
    $file2="C:\\TEMP\\test.smil";
    $contenttype2 = "application/smil";
    $fa = @file($file2);
    $xf="Content-Type: ".$contenttype2."\r\n\r\n".implode("",$fa);
    $data["MMSFile\"; filename=\"$file2"] = $xf;
    /* Repeat this sequence for additional parts
    $file3="C:\\TEMP\\?????.???";
    $contenttype3 = "?????";
    $fa = @file($file3);
    $xf="Content-Type: ".$contenttype3."\r\n\r\n".implode("",$fa);
    $data["MMSFile\"; filename=\"$file3"] = $xf;
    */
    /* A quirk of this script is that you must start all non-file parameters with \r\n */
    $data["MMSFrom"] = "\r\n" . "the domain address of the sender";
    $data["PhoneNumber"] = "\r\n" . "+type the number here";
    $data["MMSSubject"] = "\r\n" . "Subject of message" ;
    /* The MMSText field is optional */
    $data["MMSText" ] = "\r\n" . "Hello!" ;
    $x = PostToHost("0.0.0.0", 81, "test", "test", $data);
    echo $x;
    ?>
    {{ DiscussionBoard.errors[2193347].message }}
  • Profile picture of the author Aaron Sustar
    I agree with Darren Mothersele and would recommend Clickatell as well, they have an easy-to-use API that is well documented.

    You can use a similar script to the one posted by hamishmarhsal to get things up and running. An experienced developer should create a PHP function send_sms() that relies on Clickatell API and is as easy to use as the built-in email() function in less than an hour.
    {{ DiscussionBoard.errors[2194564].message }}
    • Profile picture of the author Bellasys
      As a systems architect I agree with the method suggested via the clickatell gateway. And as a Biz Dev agent I realize that one might need to stage such a thing using a script to address *80 percent* of your prospective market and allowing failures for the rest. As long as you know which clients were successfully delivered to, you can manage your clientbase.

      If you're looking for a script on the down low at this time, isolate your market and create a script to handle that market. Most of the "easily done" style comments are because they assumed a specific market. You can also use IP Geo-mapping to determine most probable Market origins for your clients-to-be, and then direct scripts to handlers for those markets. You might find that the majority of your clients arrive from 2 or 3 market bases (countries).

      Yes it's all possible. You need someone to take your specific case, and your specific needs (possibly including budget) and craft a strategy for the short term/long term goals you desire.
      Signature

      Light and Language™

      ~Max
      webmin@diamota.com

      {{ DiscussionBoard.errors[2207407].message }}
  • Profile picture of the author kiopa
    Banned
    If wanted, attached is a CSV list of 175 cell phone providers. ID#, name of provider, and the e-mail address to send to. Just replace ~phone~ in the e-mail address field with their 10 digit phone number.
    {{ DiscussionBoard.errors[2378516].message }}
  • Profile picture of the author lucasdean123
    PHP script to send an SMS message is not actually much more difficult than sending an email as you're basically doing the same thing, exclude rather than use an email server you apply an SMS gateway.
    {{ DiscussionBoard.errors[2728306].message }}
  • There are so many scripts in internet for sending text message.
    But which service or gateway would you like to use for sms or you are trying to make your own gateway?
    {{ DiscussionBoard.errors[2728612].message }}

Trending Topics