Skip to main content

SMTP email to SMS gateway

SMTP to SMS gateway

Here is one way to build yourself an SMTP to SMS gateway.

Description
Requirements
Installation

Description

This is a very simple way to build yourself a small scale SMTP to SMS gateway, to allow you to send emails to your mobile phone.

Requirements

· Old mobile phone with a pre-paid phone card, so you won't end up with a nasty bill.



· Data cable



· Phone charger



· Linux PC (Pentium 120Mhz with 32MB RAM)



· Gnokii http://www.gnokii.org/

Installation

Connect your phone to COM1 (/dev/ttyS0) using your data cable.

Download and install Gnokii.





 su -
 rpm -ivh ftp://ftp.gnokii.org/pub/gnokii/binaries/RedHat/gnokii-0.4.3-1.i386.rpm
 rpm -ql gnokii # List files
 more /usr/share/doc/gnokii-0.4.3/COPYING
 more /usr/share/doc/gnokii-0.4.3/CREDITS
 more /usr/share/doc/gnokii-0.4.3/README
 cp /usr/share/doc/gnokii-0.4.3/gnokiirc ~/.gnokiirc
 vi ~/.gnokiirc
 # set "model = " to suite your phone
 # set "connection = " to suite your cable
 # in my case I set
 # "model = 7110" 
 # "connection = dau9p"
 # and had to comment out "require_dcd = 1"
 # Now test that gnokii can find your phone
 gnokii --monitor
 # send yourself an SMS
 echo "Test SMS message" | gnokii --sendsms [your mobile number]
 
Example POP3 to SMS Perl script





 #!/usr/bin/perl
 use Net::POP3;
 my $mail_server="mailserver";
 my $username="username";
 my $password="password";
 my $phoneNumber="phonenumber";
 my $gnokii = "|/usr/bin/gnokii --sendsms $phoneNumber";
 my $pop = Net::POP3->new($mail_server)
 or die "Can't open connection to $mail_server : $!n";
 defined ($pop->login($username, $password))
 or die "Can't authenticate: $!n";
 $messages = $pop->list
 or die "Can't get list of undeleted messages: $!n";
 foreach my $msgid (keys %$messages) {
 my $email = $pop->get($msgid);
 unless (defined $email) {
 warn "Couldn't fetch $msgid from server: $!n";
 next;
 }
 my $header=1;
 my $message = "";
 # $message is a reference to an array of lines
 foreach (@$email) {
 if ($_ =~ /^n/ && $header == 1) {
 $header = 0;
 }
 if ($header == 1 &&; /^From:s/) {
 my ($from) = ($_ =~ /([wd.-_]+@[wd.-]+)/);
 $from =~ s/[<>]//g;
 $message .= "Frm $fromn";
 }
 if ($header == 1 && /^Subject:s/) {
 my ($subject) = ($_ =~ s/^Subject:/Sbj/g);
 $message .= "$_";
 }
 if ($header == 0) {
 s/are/R/gi;
 s/you/U/gi;
 s/before/B4/gi;
 s/seesyou/CU/gi;
 # etc, etc.
 $message .= "$_";
 }
 }
 # limit to SMS 160 char limit.
 $message = substr($message, 0, 160);
 # send this message
 open(GNOKII, $gnokii) or die "$0: Could not open $gnokiin";
 print GNOKII $message;
 close GNOKII;
 # mark message to be deleted at quit below
 $pop->delete($msgid);
 }
 $pop->quit($mail_server);
 exit 0;
 


Comments

Popular posts from this blog

Laravel Training Purnama Academy

Nov 2018 Purnama Academy 0838-0838-0001 Kursus Laravel Training Center INdonesia, jakarta, Bandung, Bogor, Semarang, Yogya, Palembang kalimantan, surabaya visit www.purnamaacademy.com , Laravel - Online Courses, Classes, Training, Tutorials on Lynda https://www.lynda.com/Laravel-training-tutorials/2779-0.html Learn how to use Laravel, from beginner basics to advanced techniques, with online video tutorials taught by industry experts. Top Laravel Courses Online - Updated November 2018 | Udemy https://www.udemy.com/topic/laravel/ Whether you're interested in developing web apps in the Laravel PHP framework, or building a RESTful API with Laravel, Udemy has a course to help you ... PHP Laravel Framework | Brainmatics.Com brainmatics.com/php-laravel-framework/ Translate this page Laravel merupakan framework PHP yang dirancang untuk membangun situs web ... Pada training ini diharapkan mampu membantu meningkatkan kemampuan ... Dec 3 - Dec 6 Brainmatics Laravel training - Laracasts htt...

Cara Akses Tol Bandung ke PRJ Kemayoran Jakarta , Jakartafair ? lewat tol ancol ?

Gw kira paman google sudah menyediakan segalanya... mmhhh ternyata belum.khususnya saat gw nyari jalur tol dari bandung menuju PRJ Kemayoran jakarta yang lagi diselenggarakan 2010 ini, mmhhh sepertinya i'm in trouble :) . Ok gini ceritanya balik kejakarta dari bandung ternyata ada tugas mulia menanti, rencananya mertua , adik ipar dan pasukan kecil (anak gw dan ponakan) bakal berangkat main ke jakarta hari sabtu , targetnya ? PRJ and Grand Indonesia, grand indonesia sih gak masalah.. nah PRJ ini yang jadi masalah.. maklum seumur umur cuma denger aja kehebohan PRJ ini tapi nengok kesana gw belum pernah bahkan setelah 1 tahun lebih dijakarta akses menuju kesana saja bener bener gak tau, perasaan sih dulu pernah di tunjukin supir kantor waktu gw mau ke mangga dua, tapi ya ilahhh... mana kepikiran dulu bakal ada tugas ini sekarang... :D gw coba nyari di google.. dengan mengetikan semua yang terkait akses tol dari bandung ke PRJ ini .. hasilnya gak ada,.. mungkin ada petunjuk kecil yang...

TRAINING SQL Server 2017 DATABASE ADMINISTRATOR-BANDUNG

TRAINING SQL Server 2017 DATABASE ADMINISTRATOR By Purnama Academy - Training Center January 18, 2018  No comments SQL Server 2017 DATABASE ADMINISTRATOR Syllabus Class Type           : Training Duration              : 4 Days (09.00 – 17.00) Training Description : Microsoft SQL Server is a relational database management system developed by Microsoft. As a database server, it is a software product with the primary function of storing and retrieving data as requested by other software applications—which may run either on the same computer or on another computer across a network Database administrators (DBAs) use specialized software to store and organize data. The role may include capacity planning, installation, configuration, database design, migration, performance monitoring, security, troubleshooting, as well as backup and data recovery Call us for detail syllabus ! ...