===========================================
Janek...
"> $data .= "To: Primary Contact";
^^^
That won't work.
The \n is necessary.
(and of course a valid email adress :-))"
===========================================
Actually, what happens is that your mail client will take what you put on
the Subject:,To:, and CC: lines and display that in the message. The to:
line there is completely different from the $smtp->to() line, which
specifies the actual recipient. I tend to use "fake" from/to addresses in
automated alerts because it makes it easier to set up rules in Outlook.
Here's an example from a script that I use to notify me if a machine is put
on the network that has an outdated version of our antivirus client or no
antivirus client. It is what I was trying to remember off the top of my
head, but didn't have with me. Only the names have been changed to protect
the innocent. It is a subroutine of a larger script.
sub Notify{
print "Mailing Notification...\n";
my %time = Date_Time::DTHash();
my $msg = '';
$msg .= "From: CheckNAV\n";
$msg .= "To: NAV Admins\n";
$msg .= "Subject: CheckNAV Alert for $time{wday},
$time{textmon} $time{mday}, $time{year}\n\n";
$msg .= "This message was automatically generated by
CheckNAV.\n\n";
$msg .= "One or more elements exceeded the allowed
threshold. See Details below.\n\n";
$msg .= "$_[0] systems did not have NAV installed.\n";
$msg .= "$_[1] systems had versions of NAV older than
7.5\n\n";
my $smtp = Net::SMTP->new('mailserver')|| die "$^E";
$smtp->hello('DOMAIN.COM');
$smtp->mail('CheckNAV');
$smtp->to('[EMAIL PROTECTED]');
$smtp->data($msg);
$smtp->quit;
}
I like your idea of using the HERE document. I'll probably change my
scripts to use that format. It's one of those things I've seen and liked
but never got around to experimenting with.
BTW, if anyone out there is using NAV Corporate Edition for their clients
and is frustrated with the limitations of the administrator console, I'd be
happy to share ideas. But that's another topic altogether.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]