From: Tom K. <tko...@in...> - 2002-12-20 19:10:50
|
There was some discussion about Verizon Text messaging a few = days back. Text messaging to a Verizon phone number can be sent by = emailing the message to xxx...@vt... for the ten digit phone = number xxx... I tried modifying the Danal Estes file, = "send_sprint_pcs", in mh\bin to accommodate this, but the message didn't = get through. This modifieds file "send_verizon_pcs.bat" and = "send_verizon_pcs" are pasted below. Anyone have any ideas? (Sorry about the pasting files below, but files permissions from = sourceforge rejected my file attachments.) Batch File: @mh -run send_verizon_pcs %1 %2 %3 %4 %5 %6 %7 %8 %9` Verizon File: =20 #!/usr/bin/perl # -*- Perl -*- #--------------------------------------------------------------------- # # File: # send_sprint_pcs # Description: # A perl script for sending a text string to a Sprint PCS phone # Phone/User must have sprint text messaging subscription # Author: # Danal Estes da...@ea... N5SVV # Change log: # - 01/28/00 v 1.0 Created # # This software is licensed under the terms of the GNU public license. = # Copyright 1999, 2000 Danal Estes #----------------------------------------------------------------------- use strict; my ($Pgm_Path, $Pgm_Name, $Version); use vars '$Pgm_Root'; # So we can see it in eval var subs in = read_parms BEGIN { ($Version) =3D q$Revision: 1.1 $ =3D~ /: (\S+)/; # Note: revision = number is auto-updated by cvs ($Pgm_Path, $Pgm_Name) =3D $0 =3D~ /(.*)[\\\/](.+)\.?/; ($Pgm_Name) =3D $0 =3D~ /([^.]+)/, $Pgm_Path =3D '.' unless = $Pgm_Name; $Pgm_Root =3D "$Pgm_Path/.."; eval "use lib '$Pgm_Path/../lib', '$Pgm_Path/../lib/site'"; # Use = BEGIN eval to keep perl2exe happy } use Getopt::Long; my %parms; if (!&GetOptions(\%parms, "h", "help", "text=3Ds", "to=3Ds") or=20 @ARGV or $parms{h} or $parms{help} or !$parms{text} or !$parms{to}) = { =20 print<<eof;=20 $Pgm_Name (version $Version) sends message to Verizon PCS telephone Usage:=20 $Pgm_Name [options] -h =3D> This help text -help =3D> This help text -to 9999999999 =3D> Verizon PCS phone number (10 digits) or -to xxxx =3D> name in mh.ini as = "sprint_pcs_xxxx_number=3D8005551212 -text xxx =3D> text of message to send Example: $Pgm_Name -to 8885551212 -text "This is a test" $Pgm_Name -to danal -text "This is a test" eof exit;=20 } my (%phone_numbers); &setup; $parms{to} =3D $phone_numbers{$parms{to}} unless $parms{to} =3D~ = /(\d+)/; unless ($parms{to}) { print "\nsend_sprint_pcs: You must specify -to 8005551212 option = \n"; print "or put 'sprint_pcs_NAME_number=3D8005551212' in mh.ini and = specify -to NAME option.\n\n"; exit; } &send_page ($parms{to}, "$parms{text}"); #------ use vars "%config_parms"; sub setup { require 'handy_utilities.pl'; my $private_parms =3D $Pgm_Path . "/mh.private.ini"; &main::read_opts(\%config_parms, $Pgm_Path . "/mh.ini"); &main::read_opts(\%config_parms, $private_parms) if -e = $private_parms; # Get pcs phone parms for my $parm (keys %config_parms) { next unless $config_parms{$parm}; # Ingore blank parms $phone_numbers{$1} =3D $config_parms{$parm} if $parm =3D~ = /sprint_pcs_(\S+)_number/; } for my $name (keys %phone_numbers) { print "send_sprint_pcs: $name=3D$phone_numbers{$name}\n" if = $config_parms{debug} eq 'pcs'; } } sub send_page { =20 my ($to, $text) =3D @_; print "send sprint pcs: to=3D$to, $text\n" if $config_parms{debug} = eq 'pcs'; require 'handy_net_utilities.pl'; if (&net_connect_check) { use Net::SMTP; my $server =3D 'www.vtext.com'; my $smtp; print "send_verizon_pcs: Logging into mail server $server\n"; unless ($smtp =3D Net::SMTP->new($server, Timeout =3D> 300, Debug = =3D> $parms{debug})) { print "send_sprint_pcs: Unable to log into mail server = $server: $@\n"; return; } $smtp->mail('Mister House'); # From Mister House $smtp->to("$to\@vtext.com"); $smtp->data("Subject: $text\n"); $smtp->quit; print "send_verizon_pcs: Sprint PCS message '$text' sent to = $to\n"; } else { print "\n\nsend_sprint_pcs: Can not send Verizon PCS message; = not on Internet\n\n"; } } |