On Wed, 15 Jan 2003, [EMAIL PROTECTED] wrote:
> When I want to forward the email, I do this:
> 
[...]
> print MAIL $$r{body};
[...]

> and this, of course, screws up html emails and mime-types.  What's
> the easiest way to forward the email with all the mime types intact?
> If I can get away with it, I'd rather store the entire body in one
> field, and deal with attachments, etc. later, rather than having a
> separate table for attachments.

Use something like MIME::Lite or MIME::Tools to create a message
attachment.

>From the MIME::Lite docs:

     Create a multipart message

           ### Create the multipart "container":
           $msg = MIME::Lite->new(
                        From    =>'[EMAIL PROTECTED]',
                        To      =>'[EMAIL PROTECTED]',
                        Cc      =>'[EMAIL PROTECTED], [EMAIL PROTECTED]',
                        Subject =>'A message with 2 parts...',
                        Type    =>'multipart/mixed'
                        );

           ### Add the text message part:
           ### (Note that "attach" has same arguments as "new"):
           $msg->attach(Type     =>'TEXT',
                        Data     =>"Here's the GIF file you wanted"
                        );

For a message you would use something like the 'message/rfc822' type
instead of TEXT as you see above, but otherwise the idea is the same.

All attachments of the original message will be in the attachment.
The MIME standard provides for that nicely with multipart boundaries.

Ted

_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to