Wednesday, May 8, 2024
6
rated 0 times [  6] [ 0]  / answers: 1 / hits: 8545  / 2 Years ago, sun, january 23, 2022, 1:08:14

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.


More From » software-recommendation

 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)."
Sending...";
$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"
Sent!";


Save the script as sms.php.Then on terminal run php sms.php



DONE!


[#37908] Tuesday, January 25, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
heaco

Total Points: 479
Total Questions: 124
Total Answers: 114

Location: Lesotho
Member since Sat, Oct 1, 2022
2 Years ago
heaco questions
Sun, Aug 15, 21, 03:08, 3 Years ago
Thu, Oct 14, 21, 16:28, 3 Years ago
Thu, Jun 30, 22, 09:40, 2 Years ago
;