I am trying to use Perl with MIME::Lite to send emails. I want the body of the email to contain a multi line statement and I keep getting error messages.
#! /usr/bin/perl -w
use MIME::Lite;
$vPath1='D:\\Inetpub\\ftproot\\Email';
$vName1='D:\\Inetpub\\ftproot\\Email\\emailout.txt';
$rc=system("cd $vPath1");
open(IN, "$vName1") or die 'Could not open emailout.txt';
$line=<IN>;
chomp;
@field = split(/\,/, $line);
$sendTo = $field[3];
print "Send To: ";
print $sendTo;
print "\n";
my $msg = MIME::Lite->new(
From => 'mmis@ochsner.org',
To => 'jcarrott@ochsner.org',
Subject => 're: PO from Ochsner',
Type => 'multipart/mixed',
Data => qq{
<body>
Attached you will find a Purchase Order from Ochsner Health System.
To confirm this order please fax (504) 842-9132 or email (mmis@ochsner.org)
with this purchase order and note any;
1. Item unit price difference
2. Backorder quantity by item
3. Different delivery date than requested
Ochsner Health System is not responsible for duplicate orders.
Please include buyer's name on returned copy.
If freight is going to be charged for this order, please ship the product via
Federal Express and choose "Bill Third Party" and use account #331453706
If you have any questions please call the buyer listed on the purchase order.
CONFIDENTIALITY NOTICE: Privileged/Confidential information may be contained
in this electronic transmission. The information is intended for the use of
the recipient named above. If you have received this electronic mail in error,
please immediately notify us by email or calling (504) 842-3420. You are
cautioned that any disclosure, copying, distribution, or other use of the
transmitted information is strictly prohibited.
</body>
};
$msg->attach(
Type => 'TEXT',
Path => 'D:\\Appdata\\Email',
Filename => '03041015150200.pdf',
);
$msg->send('smtp', 'smtp.ochsner.org');
For now the attachment is hard coded.
Can anybody tell me how to have a multi line text body in the email?
#! /usr/bin/perl -w
use MIME::Lite;
$vPath1='D:\\Inetpub\\ftproot\\Email';
$vName1='D:\\Inetpub\\ftproot\\Email\\emailout.txt';
$rc=system("cd $vPath1");
open(IN, "$vName1") or die 'Could not open emailout.txt';
$line=<IN>;
chomp;
@field = split(/\,/, $line);
$sendTo = $field[3];
print "Send To: ";
print $sendTo;
print "\n";
my $msg = MIME::Lite->new(
From => 'mmis@ochsner.org',
To => 'jcarrott@ochsner.org',
Subject => 're: PO from Ochsner',
Type => 'multipart/mixed',
Data => qq{
<body>
Attached you will find a Purchase Order from Ochsner Health System.
To confirm this order please fax (504) 842-9132 or email (mmis@ochsner.org)
with this purchase order and note any;
1. Item unit price difference
2. Backorder quantity by item
3. Different delivery date than requested
Ochsner Health System is not responsible for duplicate orders.
Please include buyer's name on returned copy.
If freight is going to be charged for this order, please ship the product via
Federal Express and choose "Bill Third Party" and use account #331453706
If you have any questions please call the buyer listed on the purchase order.
CONFIDENTIALITY NOTICE: Privileged/Confidential information may be contained
in this electronic transmission. The information is intended for the use of
the recipient named above. If you have received this electronic mail in error,
please immediately notify us by email or calling (504) 842-3420. You are
cautioned that any disclosure, copying, distribution, or other use of the
transmitted information is strictly prohibited.
</body>
};
$msg->attach(
Type => 'TEXT',
Path => 'D:\\Appdata\\Email',
Filename => '03041015150200.pdf',
);
$msg->send('smtp', 'smtp.ochsner.org');
For now the attachment is hard coded.
Can anybody tell me how to have a multi line text body in the email?