<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><DIV>Hello All,</DIV>
<DIV>&nbsp;</DIV>
<DIV>The Sun OS server that I am currently developing on has MIME::Lite 3.01 installed on it.&nbsp; I have search all over the Internet for a sample code that shows a way to mail an Excel file as an attached file.&nbsp; 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.&nbsp; For example, the JPG and GIF files show no image.&nbsp; The .pl file shows as binary un-readable view.&nbsp; The Excel file spits out the error (This file is not in a recognizable format.).&nbsp; 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>&nbsp;</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>&nbsp;</DIV>
<DIV>I have changed the settings around in program but no luck.&nbsp; Will you kindly look at the code and advise as to what I might be doing wrong?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Here is my sample program:</DIV>
<DIV>&nbsp;</DIV>
<DIV>#!/usr/bin/perl</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; use MIME::Lite;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; #my $fileName = "debug_20090302.xls";<BR>&nbsp; #my $fileName = "Review.pdf";<BR>&nbsp; #my $fileName = "APR_09_DUAL_OP_CK.xls";<BR>&nbsp; #my $fileName = "LG_enV_Touch_lowres_270x191.jpg";<BR>&nbsp; #my $fileName = "p.pl";<BR>&nbsp; my $fileName = "stravinsky09.gif";<BR>&nbsp; my $datDir = "/the/path/to/my/file";<BR>&nbsp; my $msg = "My message goes here";<BR>&nbsp; my $body = "Your reprot is attached herewith.";</DIV>
<DIV>&nbsp; my $message = MIME::Lite-&gt;new( From&nbsp;&nbsp;&nbsp;&nbsp; =&gt; <A href="mailto:'someone@domain.com'">'someone@domain.com'</A>,<BR>&nbsp;&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bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Encoding =&gt; '8bit',<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Data&nbsp;&nbsp;&nbsp;&nbsp; =&gt; $body );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Data&nbsp;&nbsp;&nbsp;&nbsp; =&gt; "Dear
 Sirs,\nBest regards,\nbla bla" );</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; #my ($mime_type, $encoding) = ('application/octet-stream', 'base64');</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; $message-&gt;attach ( Type&nbsp;&nbsp;&nbsp;&nbsp; =&gt; 'TEXT',<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Data&nbsp;&nbsp;&nbsp;&nbsp; =&gt; "Here's the GIF file you wanted"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; );</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; #$message-&gt;attach ( Type&nbsp;&nbsp;&nbsp;&nbsp; =&gt; 'application/octet-stream',<BR>&nbsp; #$message-&gt;attach ( Type&nbsp;&nbsp;&nbsp;&nbsp; =&gt; 'application/vnd.ms-excel',<BR>&nbsp; #$message-&gt;attach ( Type&nbsp;&nbsp;&nbsp;&nbsp; =&gt; 'application/jpeg',<BR>&nbsp; #$message-&gt;attach ( Type&nbsp;&nbsp;&nbsp;&nbsp; =&gt; 'application/pdf',<BR>&nbsp; $message-&gt;attach ( Type&nbsp;&nbsp;&nbsp;&nbsp; =&gt; 'application/gif',<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Path&nbsp;&nbsp;&nbsp;&nbsp; =&gt; $datDir,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Encoding =&gt; 'base64',<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Filename =&gt;
 $fileName,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Disposition =&gt; 'attachment' );</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; $message-&gt;send;</DIV>
<DIV>&nbsp; exit;<BR></DIV>
<DIV>Thanks.</DIV>
<DIV><BR>Peter</DIV></td></tr></table><br>