Dil ID: 9
Dil Adı: germany
Dil Kodu: de6tayfun Produkte der Marke Compaq
Dünyanın En Büyük
Elektronik Bilgi Kütüphanesi



D-8 SMC Installation and User's Guide
D.5 Contents of the MAIL.PL File
#!/usr/local/bin/perl
# Note: This is written in a very simple version of Perl for
non-experts)
# In perl, a single character match is the period ".",
contrasting with "%"
# in ConsoleWorks. Multi is "*" in both cases.
# Also for WinNT, you can not start a perl file directly,
# though you can in a command window
# Therefore create a single line script MAIL.BAT like this
# C:\Perl\Bin\Perl C:\Cwks\Actions\Event\mail.pl %1 %2 %3
%4 %5 %6
#+
# Before this can be used, please change the $remote = line in
the smtpmail subroutine
#
# Mail Action Script
#
# $ARGV[0] Console name
# $ARGV[1] Event Name
# $ARGV[2] Event Sequence Number
# $ARGV[3] Name of event context file
# $ARGV[4] Contact name(s), comma delimited
# $ARGV[5] User Supplied Paramter
#-
use Socket;
sub smtpmail {
my ($to, $subj, $whoami, $mf, @msg) = @_;
my ($port, $iaddr, $paddr, $proto, $line);
# This is site specific
$remote = "my.email.server.name.net";
$port = 25;
$iaddr = inet_aton($remote) || die "no host:
\"$remote\"\n";
$paddr = sockaddr_in($port, $iaddr);
$proto = getprotobyname('tcp');
select(SOCK);
$| = 1; # Force flush after every write or print
socket(SOCK, PF_INET, SOCK_STREAM, $proto) || die "socket:
$!";
connect(SOCK, $paddr) || die "connect: ". @SOCK ." : $!";
print SOCK "HELO $whoami\n";
sleep(2);
print SOCK "MAIL FROM: $mf\n";
sleep(2);
print SOCK "RCPT TO: $to\r\n";
sleep(2);