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...

Display Current Year With PHP

Now that 2010 is just starting, many web designers have to update the copyright year on their own websites, and their client’s websites. Many end up doing it manually and waste a lot of time with this tedious task, but some use a better method, and it’s as simple as one line of PHP. Copyright <? print(Date("Y")); ?> No longer do you have to manually edit the footer of your websites with each year that passes!

Membuat SMS Gateway sendiri menggunakan PHP MySQL

Thanks to : http://blog.rosihanari.net/membuat-sendiri-kirim-sms-gratis-via-web-dengan-php-dan-mysql Masih terkait dengan SMS gateway, dalam artikel kali ini saya akan mencoba memaparkan cara membuat sendiri aplikasi kirim SMS gratis via web. Permintaan untuk membuat artikel dengan topik ini sudah banyak masuk ke email saya maupun komentar dalam blog ini. Namun, mohon maaf baru kali ini saya bisa mewujudkannya. ( Baca tutorial lengkapnya tentang php sms gateway ) Untuk membuat fasilitas kirim SMS gratis via web, kita membutuhkan sebuah aplikasi gateway untuk mengirim SMS. Aplikasi sms gateway ini nanti kita install atau letakkan di pc yang ada di rumah kita beserta modem/hp yang tercolok pada PC tersebut sebagai alat untuk mengirim SMS. PC ini harus senantiasa terhubung ke internet untuk berkomunikasi dengan PC server yang ada di hosting. Sedangkan di dalam hosting, kita buat semacam script form untuk interface user yang ingin mengirim SMS. Untuk aplikasi sms gateway yang diinstall di...