e-mail -> sms

Ivan Simunek ivsi at nsws2.obj601.ph.spt.cz
Wed Oct 7 14:58:37 CEST 1998


> From: Marek Balaz <marek at sireal.sk>
...
> myslim, ze posielanie emailov na sms je dost brutalne. Neviem, co by som robil, keby mi 
niekto poslal attachment v maily a hlavne ked budem mat vacsi pocet znakov ako znesie smska.
> Mna by zaujimalo, ako urobit skript, ktory bude posielat subject mailu + from na sms.
> 
Myslim si, ze to pujde urcite napsat jednoduseji nez napr.:

#!/usr/bin/perl
######################################################################
##
##         Verze 1.00/dukr
##
#######################################################################

# Cislo mobilniho telefonu bez predcisli 0602
$number= "123456";

# pro PAEGASy je nutne zmenit email
$email = "$number at sms.eurotel.cz";

#cesty k binarum
$mail = "/usr/bin/mailx";
$echo = "/usr/bin/echo";

# nacita mail za stand. vstupu , pri nalezeni klic. slova "From:" a "Subject:" danou vetu 
# ulozi do promnene a pouzijeje jak telo zpravy pro SMS

while($line = <STDIN>) {
   if ( $line =~ /From:/ ) {
	chop($fr = $line) ;
	};
   if ( $line =~ /Subject:/ ) {
	chop ($su = $line); 
	};
};

#zasila Mail
system("$echo \"\\004\" | $mail -s \"$fr $su\" $email "); 




More information about the net mailing list