Subject: | support for multipart/related |
Date: | Tue, 7 Sep 2010 09:00:20 -0700 (PDT) |
To: | bug-MIME-tools [...] rt.cpan.org |
From: | roger espel llima <rogerespel [...] yahoo.com> |
hello,
I'm writing to ask about support for "multipart/related" messages within MIME::Tools.
Specifically, RFC2387, which specifies this type of multipart message, states that the Content-type line needs to have a "Type" parameter specifying the content-type of the main part of the message.
ex. Content-type: multipart-related; boundary="--1234"; Type="text/html"
As far as I can see, there is no way in MIME::Tools to pass this "type" parameter when creating the object:
my $top = MIME::Entity->build(
From => $from,
To => $to
Subject => $subject,
Type => 'multipart/related', # need to add: ; type="text/html"
);
It would be nice to be able to pass a parameter like subtype => "text/html", or main_type => "text/html". Otherwise the generated messages are not RFC-compliant, which causes real world problems (e.g Yahoo Mail doesn't display the message properly).
It would be even nicer if MIME::Tools had an automatic check for multipart/related, and added this field on its own, based on the content-type of the first part of the node.
I have been able to find a work-around, but it is not particularly nice:
# add the "type" param for multipart/related
my $ct = $top->head->get("Content-type");
$top->head->replace("Content-type", qq{$ct; Type="text/html"});
thanks in advance, and thanks for your wonderful and very useful work!!
roger