Gossamer Forum
Home : General : Perl Programming :

SMS sender

Quote Reply
SMS sender
I'm looking for a sms sender that can sends sms messages to any country and phone without having to be contected to a spesific host.
I have been on every page on the net, but no one have what I need.
I got a small script I found on a page, but that only sends to a spesial phone numbers.
Here's the script:

----------------------------

#!/usr/bin/perl


$mailprog = '/usr/lib/sendmail';

read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@Datain = split(/&/, $buffer);

$nr=-1;
foreach (@Datain) {
$nr ++;
@Datain[$nr] =~ s/\+/ /g;
@Datain[$nr] =~ s/%(..)/pack("c",hex($1))/ge;
($name, $value) = split(/=/, @Datain[$nr], 2);
if (lc($name) eq "mail_til") {
$email = $value;
}
if (lc($name) eq "mail_emne") {
$emne = $value;
}
if (lc($name) eq "ok_html") {
$ok_html = $value;
}
if (lc($name) eq "ok_html") {
$fejl_html = $value;
}
if (lc($name) eq "mail_fra") {
$fra = $value;
}
}

$udbyd = "fejl";
if ($email >= 90000000 && $email < 91999999) {
$udbyd = "mobilpost.com";
}
if ($email >= 92000000 && $email < 94000000) {
$udbyd = "sms.netcom.no";
}
if ($email >= 95000000 && $email < 97999999) {
$udbyd = "mobilpost.com";
}
if ($email >= 98000000 && $email < 98999999) {
$udbyd = "sms.netcom.no";
}
if ($email >= 99000000 && $email < 99999999) {
$udbyd = "mobilpost.com";
}
if ($email >= 40000000 && $email < 46000000) {
$udbyd = "mobilpost.com";
}

if ($udbyd eq "fejl") {
$ud_html = $fejl_html;
}
else {
$email = "$email\@$udbyd";

open(MAIL,"|$mailprog -t");
print MAIL "To: $email\n";
print MAIL "From: $fra\n";
print MAIL "Subject: $emne\n\n";
print MAIL "\n";
close (MAIL);

$ud_html = $ok_html;
}
#print "Content-type: text/html\n\n";
print "Location: $ud_html\n\n";


----------------------------------


There includes two templates.
One that shows the form and one that shows when the message is sent.
Is there anyway that I can modify this script to send SMS messages to anyone?
I can't pay anyone so I'm hoping there is a genius out there how don't need money!



Quote Reply
Re: [perlman] SMS sender In reply to
I've have some code to send sms messages world-wide (as well as operator logos and ringtones) but there is a per message fee for using it.

If this is an option then feel free to pm me or email me, otherwise you can see what people come up with here.

I don't think you'll find code on the net as the messages have to be sent through a special process to get from the web-to-phone which costs money.

Last edited by:

PaulW: Nov 15, 2001, 11:09 AM
Quote Reply
Re: [Paul] SMS sender In reply to
Hi Paul,

Still got that sms script?

Klaud

http://www.ameinfo.com
Quote Reply
Re: [klauslovgreen] SMS sender In reply to
Hi,

Yes I do.
Quote Reply
Re: [Paul] SMS sender In reply to
Care to share it?

Klaus

http://www.ameinfo.com
Quote Reply
Re: [klauslovgreen] SMS sender In reply to
It can't be used on its own. The messages have to be sent via sms-wap.com. They let you buy SMS credits in bulk - up to 10 million I believe.

Here is the code anyway...I've just been tweaking it so it may not work to begin with so let me know.

Last edited by:

Paul: Mar 7, 2003, 6:11 AM
Quote Reply
Re: [Paul] SMS sender In reply to
Cheers Paul

http://www.ameinfo.com