|
Send sms
from Desktop / Laptop :
1.
PC to Mobile Text Messaging (SMS) Software : PC to Mobile Text Messaging (SMS) Software create and send
unlimited number of text messages including (personalized
SMS, event alert and notifications, Invitations, Season
greetings, promotional campaigns, contacting employees, job
alerts to group or individuals instantly from your Personal
computer to Smart phones and Pocket PC phones on all
national or International Mobile phones Networks. The
software allows you to send SMS from your computer without
Internet connection.
It allows you to create and send bulk SMS from PC to your
customers via mobile phone connected to by Microsoft
ActiveSync and Windows Mobile Device Center to all national
or International Mobile Networks.
Data Doctor popular text messaging tool create and send,
thousand of SMS contacts from your Desktop/Laptop PCs to
Smart phones or Pocket PC phones mobile phones on
Microsoft's Windows Mobile and Windows Embedded software
platforms. Some of the supported Smart phones and Pocket PC
phones include Anextek SP230, Asus P525 Pocket PC Phone,
Audiovox PPC-6601, Carrier Devices i-Mate, Dopod StrTrk
S300, E-ten M600 Pocket PC Phone, Gigabyte gSmart i120,
Gigabyte gSmart, GSMK Cryptophone, Hitachi Pocket PC phone,
HP iPAQ, HTC MteoR Smart phone, i-mate PDAL and JAQ3, Mitac
Mio 8390, Mitac Mio, Motorola i930, Orange SPV C600
smartphone, Palm Treo 700w, Pantech PH-S8000T smart phone,
Samsung Blackjack, Sharp W-Zero3 PocketPC Phone, Sierra
Wireless Voq Phone, T-Mobile MDA, UTStarcom PPC 6700, Voxtel
W740, Yakumo PDA omikron BT and other Smart or Pocket PC
phones.
2.
Sending SMS from your website : We have noticed that the
number of websites that have the option to announce their
users via SMS that an event is due to happen has increased.
This article explains how to easily add this option to your
website
1. Import the class in your website
include("sms.class.php");
2. Instantiate class
$cls = new sms("Your_username", "Your_password", "Your_API_ID");
3. Send SMS
$result = $cls->send("PHONE_NO", "Message to be sent");
The class contains the following methods: login and send are
public methods and verify and adjust are private methods,
used only within the class.
1. The login() method builds a link depinding on the
information the user has entered and then opens that link by
using the file function available in PHP ( http://www.php.net/file
) . If the file was successfully opened, then it stores into
an array each line of content. It verifies this the first
line and stores the SESSION ID returned from ClickATell,
which will later be used to send a SMS.
// Build the link that will be used to log in to ClickATell
website
$login_link = $this->c_api_url.”/http/auth?user=”. $this->c_username.”&password=”.
$this->c_password.”&api_id=”.$this->c_api_id;
// Open link and get response
$response = file($login_link);
if($response == FALSE)
return “Could not connect to the ClickATell website”;
// If success, check the response from server, which is
located on the first line = $response[0]
$s_data = split(”:”,$response[0]);
$this->logged_in = $s_data[0] == “OK” ? true : false;
if(!$this->logged_in)
return “The username and password for ClickATell do not
match.”;
else
$this->sess_id = trim($s_data[1]);
2. The send() method is used to send a SMS via the
ClickATell API. The same method of opening a file as in the
login() method is used, only that this time you pass in the
URL opened the session id stored after logging in. You
verify the content of the file opened to see if the message
has been sent.
if($this->logged_in) {
$this->to = $to;
$this->message = $message;
// Adjust the phone no. and message
$this->adjust();
// Verify the information sent to the send() method
if(!$this->verify())
return $this->err;
// Build the link the will be used to send the message
$send_url = $this->c_api_url.”/http/sendmsg?session_id=”.
$this->sess_id.”&to=”.$this->to.”&text=”. $this->message;
// Send the message
$send_msg = file($send_url);
if($send_msg == FALSE)
return “FATAL ERROR! Could not send the message. Please try
again later”;
// Read response from server
$response_send = split(”:”,$send_msg[0]);
// Check if the message has been successfully sent
$is_ok = $response_send[0] == “ID” ? true : false;
if($is_ok)
return “The message has been successfully sent”.”<br />”;
else
return “Your message could not be sent. <br />Please contact
the webmaster of the site for more information”;
} else return “You are not logged in into your ClickATell
account”;
3. The private method verify() checks if the information
passed to the send() method is valid. The phone no. and the
message should not be empty ( http://www.php.net/manual/en/function.empty.php
). Also the length of the message should not exceed 255
characters.
$this->err = “”;
$is_ok = true;
// Verify the phone no.
if(empty($this->to)) {
$this->err .= “Please enter the receiver’s phone no.”;
$is_ok = false;
}
// Verify the message
if(empty($this->message)) {
$this->err .= “Please enter the message of the SMS.”;
$is_ok = false;
} elseif(strlen($this->message)>255) {
$this->err .= “Please enter a valid message (max. 255
characters).”;
$is_ok = false;
}
4. The private method adjust() solves some possible issues
with the phone no. and the message. If the phone no.
contains characters such as ‘(’, ‘)’, ‘+’ (e.g.
+(40)74xxxxxxx), then it strips those characters from it,
making it valid. The message will be passed in a link, so it
needs to be properly encoded ( http://www.php.net/manual/en/function.urlencode.php
). Also, to prevent spamming or confusions, if the message
contains HTML tags, they are stripped from the string using
the strip_tags function in PHP ( http://www.php.net/manual/en/function.strip-tags.php
).
//Adjust the phone no.
$repl_chars = array (”+”, ” “, “(”, “)”, “\r”, “\n”,
“\r\n”);
$this->to = str_replace($repl_chars, “”, $this->to);
//Adjust the message
$this->message = strip_tags($this->message);
$this->message = urlencode($this->message);
This article explains some PHP functions that are vital to
working with opening files and reading their content,
validating content, etc. , and it also provides useful
information about how to easily integrate SMS in your
website.
You may use it in a lot of ways, for instance you could set
up a cronjob on your server to send SMS to your clients
announcing them that they have just received a new private
message from another user. If you are designing a web
application for a business, you may this
|