dshaw21369
Programmer
- Jul 8, 2002
- 64
I'm Sending an html attachment using MIME:LITE and the email is sending an attachment however the html attachment displays all the file names in the directory rather than the html contents. My Ultimate Goal is to attach an html file with yesterdays date. Any Suggestions?
Here is my code.
#!/usr/bin/perl
$yesterday = time() - 86400; # 86400 is num seconds in 1 day
($sec, $min, $hours, $day_of_month, $month, $year , $wday, $yday, $isdst) = localtime($yesterday);
$month++;
$Reports_Path = '/export/home/egate/egate/client/SeeBeyond_Yesterdays_Output_Files';
$reports_filebase ='reports';
$reports = $reports_filebase.sprintf("_%02d_%02d_%02d.htm", $month, $day_of_month, $year % 100);
use MIME::Lite '/usr/perl5/site_perl/5.005/MIME';
$msg = MIME::Lite->new(
To =>'denesa.k.shaw@centerpointenergy.com',
Subject =>'Yesterdays Reports',
Type =>'multipart/mixed'
);
$msg->attach(Type => 'text/html',
Path => "$Reports_Path",
Filename =>"$reports\n",
Disposition => 'attachment'
);
$msg->send();
Here is my code.
#!/usr/bin/perl
$yesterday = time() - 86400; # 86400 is num seconds in 1 day
($sec, $min, $hours, $day_of_month, $month, $year , $wday, $yday, $isdst) = localtime($yesterday);
$month++;
$Reports_Path = '/export/home/egate/egate/client/SeeBeyond_Yesterdays_Output_Files';
$reports_filebase ='reports';
$reports = $reports_filebase.sprintf("_%02d_%02d_%02d.htm", $month, $day_of_month, $year % 100);
use MIME::Lite '/usr/perl5/site_perl/5.005/MIME';
$msg = MIME::Lite->new(
To =>'denesa.k.shaw@centerpointenergy.com',
Subject =>'Yesterdays Reports',
Type =>'multipart/mixed'
);
$msg->attach(Type => 'text/html',
Path => "$Reports_Path",
Filename =>"$reports\n",
Disposition => 'attachment'
);
$msg->send();