I used the MIME::Lite module and sent an email with 2 attachments. It worked going to various users on our system.
The first test to a vendor crashed their email server. The system crashed when they double clicked on the email to open it.
Does anything I am doing look like it could cause a system crash??
The first test to a vendor crashed their email server. The system crashed when they double clicked on the email to open it.
Code:
#! /usr/bin/perl -w
use MIME::Lite;
$vPath1 = 'D:\\Inetpub\\ftproot\\Email';
$vName1 = 'D:\\Inetpub\\ftproot\\Email\\emailout.bak';
$vName2 = 'D:\\Program Files\\OHS\\Email\\Email_Cover_Sheet.rtf';
$message = 'Attached is a PO from Ochsner Health System and instructions.';
$Priority = 1;
$rc=system("cd $vPath1");
open(IN, "$vName1") or die 'Could not open emailout.bak';
foreach (<IN>)
{
chomp;
my @field = split /,/;
$sendTo = $field[3];
$fileNm = $field[0];
$vName3 = "D:\\Appdata\\Email\\" . $fileNm . ".pdf";
$msg = MIME::Lite->new(
From => 'purchasing@ochsner.org',
To => $sendTo,
Subject => 'RE: PO FROM OCHSNER',
'X-Priority' => $Priority,
Type => 'multipart/mixed');
$msg->attach(
Type => 'TEXT',
Data => $message);
$msg->attach(
Type => 'application/rtf',
Path => $vName2,
Filename => $vName2,
Disposition => 'attachment');
$msg->attach(
Type => 'pdf/pdf',
Path => $vName3,
Filename => $vName3,
Disposition => 'attachment');
$msg->send('smtp', 'smtp.ochsner.org');
}
close (IN);
$rc=system("del /Q D:\\Inetpub\\ftproot\\Email\\emailout.bak");
Does anything I am doing look like it could cause a system crash??