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,
            ),
        ],
}

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.
-- 
Bernhard Graf

_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to