E-Mail notification to users via SMS (gateway script ok, but notification script?!?)
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
E-Mail notification to users via SMS (gateway script ok, but notification script?!?)
Hi all!
I have Linux on my server. And i want to make a e-mail notification eg. "You have new mail" to my users via GSM SMS. I have sms script what send via command line.
The problem is:
How i make some script what reads the mail file and send new mail notification to registered users own GSM phone???
This is a script that does it for you, http://freshmeat.net/projects/pop2smswebde/
On of the best stuff in linux is that you dont need to create sutch scripts / programms download one and work on it a few days to get the results your want.
Dam but are there any web based site that offer *free* sms services? in france, austria... you can go onto sms.fr (whatever) and enter the telephone number ans the message and click send. If you look at the html code, ull see
form action="send.sms.php" method="POST"..
input type="num" name="number...."
input type="title" name="title..." etc..
I have on my site http://titanix.d2g.com the sms send. and that works to a finnish operador
i only put to the script the intranet ip addres i going to try if work..
yes
now is work via my server.
I haved to modify the script.
But this script is no good
perhaps the best solution is:
the file /var/log/maillog
tail -f to the file and take (grep?!?) the <to=USER@myserver.com> and send via that to the USER the SMS.
off course i have to make to the website a script, who wants the sms notification
the problem is how i grep? i only want the part of begin @myserver.com>.....
i havet tried a lot of, but i feel that, grep does take a part of line?!?
#!/usr/local/bin/php -q
#
# An eleet Script By oliver (pH)
# littlescrip.php email
#
<?
$RAW__EMAIL = $argv[1];
print("Hello, i am going to explode his email .\n");
$STAR__EMAIL = explode("@", '$RAW__EMAIL');
print("Ok, I have done it, and its $STAR__EMAIL.\n"
?>
You could make it in BASH as you wish but if your wanting to make it web based, PHP sounded better. ITs very simple. You could add what you want in it... Just ask
# CREATE TABLE registered (name varchar(250), mail varchar(250));
#
if (!isset($mode))
{
echo <<< __ENDOFREGISTRATION__
<form action="$PHP_SELF?mode=register" mothode="post">
Enter Your Name <input type="text" name="name">
Enter Your E-Mail <input type="text" name="mail">
__ENDOFREGISTRATION__;
}
if ($mode == "register")
{
mysql_connet("$M_HOST","M_USER","M_PASS");
mysql_select_db("$M_DB");
mysql_query("INSERT INTO registered (name,mail) VALUES ('$name','$mail')"):
if (mysql_error() == "") { echo "You are Registerd"; }
}
/* Thats For the simple registration */
?>
then it talk for itself, fdopen, system, mail, and your done. (And my boss just got in i must run (; )
Rip it up, Find out how it checks for the mail, find out how and where it sends the sms and just change that function to your web based one, i really think php will do the job because you would need a sript that runs localy and another one calling the site and php does that. Its not only a Great powerfull web based language but also an exelent shell ;D
But im promoting PHP as alwas just continu as you feel everything is possible.
i have alredy findet out how pop2smswebde it works
i have ripped to work on my server..
The works via pop account and sends SMS via (method POST) WWW (i have changet to my server ( http://titanix.d2g.com/sms.shtml etc.. )
That was easy to get work, but i only want a script to run on linux shell as root or noboy using sh or bash, to spy when users get a mail, then send sms to user mobile phone.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.