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.
Asked
Active
Viewed 8,657 times
9
-
possible duplicate of Sending SMS in Ubuntu – Uri Herrera Jun 03 '12 at 05:15
-
2You mean app to send sms via webservice like way2sms.com? If yes mention it in the question :-) – Tachyons Jun 03 '12 at 07:54
3 Answers
6
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 . http://pastebin.com/AeiQvaJG – Raja G Jun 03 '12 at 07:57
-
sudo apt-get install curl php5-curl
installs cURL and cURL API for PHP. That'll fix the error. – l0n3sh4rk Jun 03 '12 at 08:01 -
1@Raja that link is not working . Well anyways dont use pastebin. see here why – Ashu Jun 03 '12 at 08:01
-
@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 G Jun 03 '12 at 08: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 G Jun 03 '12 at 08:08
-
@Raja, 160by2 can be slow at delivery at times, but works okay. Welcome! – l0n3sh4rk Jun 03 '12 at 08:18
-
-
if i have received i will make mark as accepted answer my friend but your idea is really good +1 . – Raja G Jun 03 '12 at 13:14
-
@l0n3_shArk same thing with me...it says message sent but no messages received. However, sending from the web delivers the message instantly. – Khurshid Alam Jun 03 '12 at 13:35
-
@everyone, I've edited my code, please note the change, I'm currently using this to text my friends after TRAI imposed restrictions on the number of SMSes sent per day! – l0n3sh4rk Jun 03 '12 at 13:45
-
@l0n3_shArk...how to install php? :/ i mean i dint get what to do exactly when u say install php? and how to run the script after that? – Nirmik Jun 03 '12 at 14:21
-
-
@Nirmik
sudo apt-get install php5-cli php5-curl curl
.Then save the script as sms.php.Modify your username, password. Then on terminal runphp sms.php
. – Khurshid Alam Jun 03 '12 at 14:35 -
-
@l0n3_shArk...can i add
#!usr/bin/env php
in the begining to make it like a shell script that can be run by clicking on it? i've done it with python files by adding#!usr/bin/env python
– Nirmik Jun 03 '12 at 20:10 -
@all...that worked...added the line,made a launcher..and its now workin awesome! just click ;) thanx for the script!! One for way2sms would be even better! – Nirmik Jun 03 '12 at 20:34
-
@l0n3_shArk Its not working anymore, showing a error: "page not found". Could you please update the script? – Khurshid Alam Mar 23 '13 at 10:59
-
-
Its not working because the url
http://160by2.com/SendSMSAction
in the code is no loger valid. When I am using their website the url is something like this:http://m.160by2.com/FebSendSMS?id=DDF62DG9ED**************.7043
. I am trying to find out the correct url, but so far no luck. – Khurshid Alam Jul 12 '13 at 16:00 -
3
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

Smith
- 31
- 1
-
Welcome & thanks for your answer. Please note that it's asked for a desktop client/application – Mateng Nov 19 '12 at 15:27
-1
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.