MIME::Lite or /bin/mail help please

B

Billy Patton

I'm trying to get a weekly to be mailed through a cron job.
I have a perl scripts that creates an excel spread sheet.
I want to attach this spread sheet to some mail and send to my group as
my weekly report.

I cat find where I can do an attachment through /bin/mail do Ive tried
MIME::Lite.

What the code does now is that it will make the attachment and send
it,but when it gets there it is empty.

Here's what I have so far:
#!/usr/local/bin/perl

use strict;
use warnings;
use MIME::Lite;
require "ctime.pl";

my $date = ctime ( time );
my $file = '/home/bpatton/c014.report.xls';
chomp $date;
my $msg = MIME::Lite->new(
From => '(e-mail address removed)' ,
To => '(e-mail address removed)' ,
Subject => "Weekly from Billy Patton $date",
Type => 'multipart/mixed',
);
$msg->attach(Type => 'TEXT' ,
Data => "See attachment or look at $file" ,
);
$msg->attach(Type => 'AUTO' ,
Filename => $file,
Path => '/home/bpatton',
Disposition => 'attachment' ,
);
$msg->send;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top