Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- SendingHTML files via e-mail
June 24, 2008, 1:30 pm
rate this thread
I am trying to write a simple Perl script that will accept the HTML
file as one argument and then send an e-mail with the HTML file. I
don't want the HTML file attached to the e-mail but to be part of the
body of the e-mail. In other words, I need the HTML file that I am
sending to be the actual body of the e-mail.
I am new to Perl so this is what I have so far:
use Date::Calc qw(:all);
# SendTo email id
my $to_id = 'firstname.lastname@example.org';
chomp (my $date = `date +%A" "%B" "%d","%Y`);
my $subject = sprintf("SAN Capacity Report:
# create a new MIME Lite based email
my $msg = MIME::Lite->new
From => 'email@example.com',
To => $to_id,
Subject => $subject,
Type => 'multipart/mixed',
I am not sure how to make the $filename which is the HTML file passed
to the script so it gets sent as part of the body of the e-mail.
Any help would be appreciate it.
Re: SendingHTML files via e-mail
I'm not sure either, but did you read the docs for MIME::Lite?
It contains several examples that ought to work as a guidance.
Try to modify your script with help of the docs, and come back if you
don't find a solution that way.