Eric
I arrived at this method (works under mod_perl)to send images as attachements:


      $msg = build MIME::Lite From => $aApobj->getEmail_Address,
          To  => $recip, Subject => $Sub,
          Type => 'TEXT', Data => $lPB;

      $OpStatus .= "<BR><B>Recipient: $recip.</B>";
      if($aReceipt ne '') {  # If return reciept requested.
        $msg->add("Disposition-Notification-To"    => $aApobj->getEmail_Address);  
      }
      if(0==0) { # Production mode.
        attach $msg
          Type     => 'image/save_as_tiff',
          Encoding => 'base64',
          Path     => $TempFileName,
          Filename => $NewDocName; 
      }

Had to make a bogus type to get it to work right.  Don't know why I have "build" in 
there.

Chuck

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 26, 2003 8:54 AM
To: [EMAIL PROTECTED]
Subject: MIME::Lite and Excel


Hey all,

   I am trying to get MIME::Lite to attach an Excel spreadsheet created via
Spreadsheet::WriteExcel to an outgoing email and something is not working
quite right.

   Here's the code:

    my $mail = MIME::Lite->new(
             From       =>'[EMAIL PROTECTED]',
             To         =>'[EMAIL PROTECTED]',
             Subject    =>"New Report",
             Type       =>'multipart/mixed',
             Data       => $stuff,
                        );
         $mail->attach( 
                    Type        =>'application/vnd.ms-excel',
                    FH          => $file,
                    Filename    => $workbook,
                    ReadNow     => 1,
                    Disposition => 'attachment',
                      );
         $mail->send || warn "mail attempt failed: $@";

    All documentation and forums that I have Googled has said this is the way
to do this. But I get an error like this:

binmode() on unopened filehandle at usr/lib/perl5/site_perl/5.8.0/MIME/Lite.pm
line 1816.
read() on unopened filehandle at /usr/lib/perl5/site_perl/5.8.0/MIME/Lite.pm
line 1817.

    What exactly is going wrong here? Thanks in advance for any pointers and
by the way, this is my first question to the list... 

Eric











-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html

Reply via email to