g_speran has asked for the wisdom of the Perl Monks concerning the following question:
I asked this question a while back but I never got it resolved. It could be the way I asked it. So I will try to explain in detail this time. (Below is the code in reference)
When I send an e-mail using MIME::Lite, I need my log file "available.log" to be an attachment and the body of the e-mail to be the contents of "available.log", which, based upon the below code would contain :
Line 1
Line 2
Line 3
What is happening, still, is that the "available.log", IS properly received as an attachment, BUT the body contents of the e-mail contains:
/export/home/netbackup/logs/available.log
which is the absolute path to the file but not the contents of the log file.
I do have a screen shot for a visual if this would help anyone.
Thanks and sorry for posting again
Gary
use IO::Tee; $OutFile = "/export/home/netbackup/logs/available.log"; $tee = new IO::Tee(\*STDOUT, new IO::File(">$OutFile")); print $tee "Line 1\n"; print $tee "Line 2\n"; Print $tee "Line3\n" ##################################################################### #### Emailing the Reports now ##################################################################### # Send An Email with Attachment MIME::Lite->send('smtp',"$Email_Server",Timeout=>60); $msg = MIME::Lite->new( From => 'Netbackup@company.net', To => "$Email_List", Subject => "$hostname} Available Media Report", Type => 'multipart/mixed'); $msg->attach(Type => 'application/vnd.ms-word', Filename => `basename \"${OutFile}\"`, Path => "$OutFile", ReadNow => 1, Disposition => 'attachment'); $msg->attach(Type => "text/plain", Encoding => 'base64', Data => $OutFile); $msg->send(); ##################################################################### #### End Emailing the Reports #####################################################################
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: MIME::LITE - Body contents and attachments
by chargrill (Parson) on Apr 17, 2006 at 19:01 UTC | |
by Anonymous Monk on Apr 19, 2006 at 15:05 UTC | |
by chargrill (Parson) on Apr 19, 2006 at 16:55 UTC | |
|
Re: MIME::LITE - Body contents and attachments
by ikegami (Patriarch) on Apr 17, 2006 at 19:04 UTC |