Hi Michael,

> I have a report that is in HTML format, it is about 120k of text.  When
> is use the program fragment below to send the report, I get only the
> first 8k (about) and that's it.
>

judging by your code, you want to attach an HTML file as attachment (  Type
=>'multipart/related',
 ) , and only 8 K are geting over.

> The problem is the mail command can't format the message as html when it's
read.

    Mail client is ASCII based you can however use a different editor { man
mail }.

Here is my script that does what you wanted and sends the whole file over
{ atleast on my box }:


<~~~ CUT

use MIME::Lite;
use Net::SMTP;
$smtp = Net::SMTP ->new('yourmail.server);
$smtp->mail('[EMAIL PROTECTED]');
$smtp->to('[EMAIL PROTECTED]);
$smtp->data( );


my $msg = MIME::Lite->new(
                 From     =>'Joe',
                 To       =>'Shmoe',
                 Subject  =>'HTML Test',
                 Type    =>'multipart/related',
                 );

 $msg->attach(
               Type    => 'text/plain',
               Data => 'HERE IS YOUR HTML PAGE',
                );



 $msg->attach(
       Type    => 'text/html',
       Path   =>'full_file_name',
       Disposition => 'attachment',
  );



# send the message over
$smtp->datasend( $msg->as_string() );


# close smtp connection
$smtp->dataend();
$smtp->quit;

<~~~ paste


----- Original Message ----- 
From: "Michael Weber" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, May 30, 2003 4:18 PM
Subject: MIME::Lite only sends 8k?


> I have a report that is in HTML format, it is about 120k of text.  When
> is use the program fragment below to send the report, I get only the
> first 8k (about) and that's it.
>
> I ran into this same problem with MFMail, but it runs fine with the
> mail command (sendmail).  The problem is the mail command can't format
> the message as html when it's read.  What I see is the html source code.
>  The program below gets the formatting right, but it only sends the
> first small piece of the file.
>
> What am I doing wrong?
>
> I'm running RH 7.3 and perl 5.8.0.
>
> Thanx!
>
> #!/usr/bin/perl -w
>
> use strict;
> use MIME::Lite;
>
> my $msg = MIME::Lite->new(
>                  From     =>'[EMAIL PROTECTED]',
>                  To       =>'[EMAIL PROTECTED]',
>                  Subject  =>'HTML Test',
>                  Type    =>'multipart/related',
>                  Data     =>"Here's another test."
>                  );
>
> $msg->attach(
>                 Type    => 'text/html',
>                 Path
> =>'/usr/local/results/111.222.333.444/report.html'
>                 );
>
> $msg->send;
>
>
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to