I'm not very experienced with perl and especially Mime::Lite
but I see a strange phenomena here I cannot explain without some help:

This script is taken largely from the examples in Mime::Lite and has
had the email addressess rewritten:

================
#!/usr/local/bin/perl -w
use MIME::Lite;

@msgar = (
   "here we have a message\n",
   "contained in an array\n",
   "including necessary\n",
   "newlines\n" 
            );

### Create the multipart "container":
$msg = MIME::Lite->new(
  From    =>'[EMAIL PROTECTED]',
  To      =>'[EMAIL PROTECTED]',
  Subject =>'A message with 2 parts...',
  Type    =>'multipart/mixed'
                        );
### Attach a part 
  $msg->attach(Type    =>'TEXT',
  Data           => "@msgar",
  Dispostion     =>'attachment',
  Encoding       =>'7bit'                     
            );

##1  ### Add another part:
  $msg->attach(Type    =>'TEXT',
  Data           => "@msgar",
  Dispostion     =>'attachment',
  Encoding       =>'7bit'

##2    $msg->attach(Type     =>'TEXT',
##2   Data        =>"@msgar",
##2   Disposition => 'attachment',
##2   Encoding       =>'7bit'                     
            );

### Write it to a filehandle:
$msg->print(\*STDOUT);
### Mail it
# $msg->send;
============
According to perldoc MIME::Lite, at least my reading, that should show
a message with two attachements.  Both should have the disposition set
to `attachment'.

But when I run it they both show dispositions of `inline'.

Thats already odd, but now I noticed just by accident that if I run it
with the code uncommented at ##2  and comment the code above it just
below ##1, that is, swap them out.  Then the first remains `inline'
but the second shows up as `attachment'  and in fact when actually
sent to my address.  My mail reader (emacs Gnus) sees it that way too.

I cannot see any difference in the code to produce the second effect
but more importantly why isn't `disposition' set to attachement as per
my code?

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to