Subject: | Unable to create multipart/alternative emails |
Date: | Thu, 10 Jan 2008 00:13:41 +0100 |
To: | bug-Catalyst-View-Email [...] rt.cpan.org |
From: | Bernhard Graf <catalyst3 [...] augensalat.de> |
I'm unable to create multipart/alternative email with C:V:Email 0.10.
This worked with 0.06:
$stash->{email} = {
header => [ From => $from, To => $to, Subject => $subject],
content_type => 'multipart/alternative',
parts => [
Email::MIME->create(
attributes => {
content_type => 'text/plain',
charset => $cs_plain,
encoding => $enc_plain,
},
body => $plain,
),
Email::MIME->create(
attributes => {
content_type => 'text/html',
charset => $cs_html,
encoding => $enc_html,
},
body => $html,
),
],
}
The content_type setting is ignored by C:V:Email 0.10 .
Previous C:Plugin::Email wanted content_type in the same way as the
underlying Email::MIME::Creator:
attributes => {content_type => 'multipart/alternative'}
but this doesn't work either in C:V:Email 0.10 .
From how I see the code, it is broken at least in process:
my %mime = ( header => $header );
if ( $parts and ref $parts eq 'ARRAY' ) {
$mime{parts} = $parts;
} else {
$mime{body} = $body;
}
if ( $mime{attributes} and not $mime{attributes}->{charset} and
$self->{default}->{charset} )
{
$mime{attributes}->{charset} = $self->{default}->{charset};
}
$mime{attributes} is queried here, but never set before.
--
Bernhard Graf