Hi I am looking for some kind of script/software that can help me to send SMS from my Ubuntu machine . A desktop client/application actually by using web services which we use to send sms like way2sms.com or 160by2.com etc.
3 Answers
Here you go. Create an account at 160by2.com and install php on your system.
sudo apt-get install php5-cli php5-curl curl
Paste your number and password where i've mentioned and run this script:
<?php echo"Phone: ";$phno=trim(fgets(STDIN)); echo"Message: ";$msg=trim(fgets(STDIN)); echo"Message Length: ".strlen($msg)."\nSending..."; $yournumber=''; //your number inside the single quotes $yourpassword='';//your password inside the single quotes $cur=curl_init("http://160by2.com/re-login"); curl_setopt($cur,CURLOPT_POST,1); curl_setopt($cur,CURLOPT_POSTFIELDS,"username=$yournumber&password=$yourpassword"); curl_setopt($cur,CURLOPT_COOKIESESSION,1); curl_setopt($cur,CURLOPT_COOKIEJAR,"cookie"); curl_exec($cur); curl_close($cur); $cur=curl_init("http://160by2.com/SendSMSAction"); curl_setopt($cur,CURLOPT_POST,1); curl_setopt($cur,CURLOPT_AUTOREFERER,1); curl_setopt($cur,CURLOPT_COOKIEFILE,"cookie"); curl_setopt($cur,CURLOPT_POSTFIELDS,"mobile1=$phno&msg1=$msg&action1=sa65sdf656fdfd"); $x=curl_exec($cur); curl_close($cur); echo"\nSent!";
Save the script as sms.php.Then on terminal run php sms.php
DONE!
-
Hi thanks for the answer i have tried and got an error . pastebin.com/AeiQvaJG– Raja GJun 3, 2012 at 7:57
-
sudo apt-get install curl php5-curl
installs cURL and cURL API for PHP. That'll fix the error. Jun 3, 2012 at 8:01 -
1
-
@l0n3_shArk Hi i have tried installing php5-curl from synaptic and your script executed successfully but i have not received any message up to now . Thanks man ,your script good idea .– Raja GJun 3, 2012 at 8:07
-
@Ashu just now i have checked the pastebin link and its fine . but thanks for the info about that :) i am not gonna touch it again .– Raja GJun 3, 2012 at 8:08
It's simple.
Just go register at CS Networks and you may send messages from terminal with the following command:
wget http://api.cs-networks.net:9011/bin/send?USERNAME=yourusername&PASSWORD=yourpassword&DESTADDR=447123456789&MESSAGE=somemessageSOURCEADDR=test
-
Welcome & thanks for your answer. Please note that it's asked for a desktop client/application– MatengNov 19, 2012 at 15:27
Here is a link for downloading .deb files for both 32-bit and 64-bit versions of sendsms / gsendsms. Sendsms is open source software published under a GNU/GPL license.
https://www.cs-networks.net/index.php/products/toolsandutils/linux-sendsms
It will allow you to send messages from the terminal / or simple GUI under GNOME.