5.3
Enter the Mail Server Name in the ConsoleWorks
Script
Modify the file MAIL.PL to include the name of the mail server. This
file is in the folder C:\Cwks\Actions\Event.
Example 5–1 Modifying the ConsoleWorks Script (MAIL.PL)
#!/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";
.
.
.
if ($domail) {
5-14
SMC Installation and User's Guide