Sorry about that guys, thought it might be a generic enough question to not NEED a code sample.
my $from_name = $mail_from;
my $from_address = $display_name;
my $to_address = $_;
my $subject = 'Daily Report';
my $mime_type = 'TEXT';
my $message = "Your PDF report is attached.";
# Create the initial text of the message
my $mime_msg = MIME::Lite->new(
From => $from_address,
To => $to_address,
Subject => $subject,
Type => $mime_type,
Data => $message
)
or die "Error creating MIME body: $!\n";
my $filename = 'daily.pdf';
my $recommended_filename = 'daily.pdf';
# Attach the file
$mime_msg->attach(
Type => 'application/pdf',
Path => $filename,
Filename => $recommended_filename
)
or die "Error attaching test file: $!\n";
As you can tell from the code, most, if not ALL the of important info comes from variables, most of which come from a config file, or are retrieved from a database.