I am running a perl script that generates an excel doc and then emails it as an attachment. I can generate the excel file fine. I can scp it from the box and open it with no problems. When I send it over email, the file does open properly. The file in email is only 288 B, but on the server it is 2K. Please help.
I am not sure it matters, but I am running this script in the Solaris OS.
my $emailrep = MIME::Lite->new(
To => $EMAIL_RCPT,
Subject => $SUBJECT,
Type => 'multipart/mixed'
) || &errordie("-emailreport- Cannot create new email with MIME::Lite: $!");
$emailrep->attach (
Type => 'TEXT',
Data => $mymessage
) || &errordie("-emailreport- Cannot create new email with MIME::Lite: $!");
$emailrep->attach (
Path => $OUTDIR,
Filename => $EXCELREPORT,
Type => 'application/vnd.ms-excel',
Dispostion => 'attachment'
) || &errordie("-emailreport- Cannot create email with attachment: $!");
$emailrep->send("sendmail");