<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><DIV>Hello All,</DIV>
<DIV> </DIV>
<DIV>The Sun OS server that I am currently developing on has MIME::Lite 3.01 installed on it. I have search all over the Internet for a sample code that shows a way to mail an Excel file as an attached file. I found a few sample codes and they all successfully send the test files (*.pdf, *.xls, *.txt, *.pl, *.jpg, *.gif, *.zip) to my Exchange email account, however, when I attempt to open these files, not one will open successfully. For example, the JPG and GIF files show no image. The .pl file shows as binary un-readable view. The Excel file spits out the error (This file is not in a recognizable format.). The PDF file reports (Adobe Reader could not open 'Review.pdf' because it is either not a supported file type or because the file has been damaged.)</DIV>
<DIV> </DIV>
<DIV>I FTPed to the server and downloaded the files to my PC and was able to open all the files successfully but through MIME::Lite, I can't.</DIV>
<DIV> </DIV>
<DIV>I have changed the settings around in program but no luck. Will you kindly look at the code and advise as to what I might be doing wrong?</DIV>
<DIV> </DIV>
<DIV>Here is my sample program:</DIV>
<DIV> </DIV>
<DIV>#!/usr/bin/perl</DIV>
<DIV> </DIV>
<DIV> use MIME::Lite;</DIV>
<DIV> </DIV>
<DIV> #my $fileName = "debug_20090302.xls";<BR> #my $fileName = "Review.pdf";<BR> #my $fileName = "APR_09_DUAL_OP_CK.xls";<BR> #my $fileName = "LG_enV_Touch_lowres_270x191.jpg";<BR> #my $fileName = "p.pl";<BR> my $fileName = "stravinsky09.gif";<BR> my $datDir = "/the/path/to/my/file";<BR> my $msg = "My message goes here";<BR> my $body = "Your reprot is attached herewith.";</DIV>
<DIV> my $message = MIME::Lite->new( From => <A href="mailto:'someone@domain.com'">'someone@domain.com'</A>,<BR> To => <A href="mailto:'someone_else@some_other_domain.com'">'someone_else@some_other_domain.com'</A>,<BR> Subject => $msg,<BR> #Type =>
'text/plain',<BR> Type => 'multipart/mixed' );<BR> #Encoding => '8bit',<BR> #Data => $body );<BR> #Data => "Dear
Sirs,\nBest regards,\nbla bla" );</DIV>
<DIV> </DIV>
<DIV> #my ($mime_type, $encoding) = ('application/octet-stream', 'base64');</DIV>
<DIV> </DIV>
<DIV> $message->attach ( Type => 'TEXT',<BR> Data => "Here's the GIF file you wanted"<BR> );</DIV>
<DIV> </DIV>
<DIV> #$message->attach ( Type => 'application/octet-stream',<BR> #$message->attach ( Type => 'application/vnd.ms-excel',<BR> #$message->attach ( Type => 'application/jpeg',<BR> #$message->attach ( Type => 'application/pdf',<BR> $message->attach ( Type => 'application/gif',<BR> Path => $datDir,<BR> #Encoding => 'base64',<BR> Filename =>
$fileName,<BR> Disposition => 'attachment' );</DIV>
<DIV> </DIV>
<DIV> $message->send;</DIV>
<DIV> exit;<BR></DIV>
<DIV>Thanks.</DIV>
<DIV><BR>Peter</DIV></td></tr></table><br>