When i tried to send email with attachments using MIME::Lite module in Centos.
The Email sent successfully but sent date is not displaying in rackspace
See my example code below:
#!/usr/bin/perl
use MIME::Lite;
use Net::SMTP;
$to = 'xxx@yyy.net';
$cc = 'test@gmail.com';
$from = 'DailyReports@test.com';
$subject = 'Test Email';
$message = 'This is test email sent by Perl Script';
$msg = MIME::Lite->new(
From => $from,
To => $to,
Cc => $cc,
Subject => $subject,
Type => 'multipart/mixed'
)or die "Error creating multipart container: $!\n";
# Add your text message.
$msg->attach(Type => 'text',
Data => $message
);
# Specify your file as attachement.
$msg->attach(Type => 'application/openoffice',
Path => '/tmp/Daily_Transactions_May_2014.xls',
Filename => 'Daily_Transactions_May_2014.xls',
Disposition => 'attachment'
);
#MIME::Lite->send('Mail', "/usr/sbin/sendmail);
open (SENDMAIL, "| /usr/lib/sendmail -t");
$msg->print(\*SENDMAIL);
close(SENDMAIL);
#$msg->send;
$str = $msg->as_string;
print "$str";
print "Email Sent Successfully\n";