Skip to content

parts_add() on multipart/mixed results in two multipart/mixed #17

@futon88

Description

@futon88

It's not clear whether this is an issue, or not, but it certainly caught me by surprise:

my $mixed = Email::MIME->create(
    attributes => {content_type => "multipart/mixed"},
    header_str => [Subject => "Subject"],
);
my $related = Email::MIME->create(
    attributes => {content_type => "multipart/related"},
);
$mixed->parts_add([$related]);
print $mixed->as_string;

Results in:

Subject: Subject
Date: Mon, 25 Aug 2014 10:13:30 -0400
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="1408976010.DFC040.11480"


--1408976010.DFC040.11480
Subject: Subject
Date: Mon, 25 Aug 2014 10:13:30 -0400
MIME-Version: 1.0
Content-Type: multipart/mixed


--1408976010.DFC040.11480
Date: Mon, 25 Aug 2014 10:13:30 -0400
MIME-Version: 1.0
Content-Type: multipart/related

--1408976010.DFC040.11480--

My expectation is that doing a parts_add() with a single new part would be equivalent to parts_set() with the same part, which results in:

Subject: Subject
Date: Mon, 25 Aug 2014 10:15:15 -0400
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="1408976115.Be2FCB00.11602"


--1408976115.Be2FCB00.11602
Date: Mon, 25 Aug 2014 10:15:15 -0400
MIME-Version: 1.0
Content-Type: multipart/related


--1408976115.Be2FCB00.11602--

Anecdotally, these mixed-within-mixed messages appear to render completely blank in Windows Live Mail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions