Skip to content

Commit

Permalink
Swap attachment and text position (suggested by Mike Tonks)
Browse files Browse the repository at this point in the history
  • Loading branch information
maros committed Nov 15, 2012
1 parent 6117f83 commit de66f3b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/Mail/Builder.pm
Original file line number Diff line number Diff line change
Expand Up @@ -492,10 +492,10 @@ sub build_message {
Boundary => $self->_get_boundary(),
Encoding => 'binary',
);
$mime_entity->add_part($self->_build_text(Top => 0));
foreach my $attachment ($self->attachment->list()) {
$mime_entity->add_part($attachment->serialize());
}
$mime_entity->add_part($self->_build_text(Top => 0));
# ... without attachments
} else {
$mime_entity = $self->_build_text(%email_header);
Expand Down
4 changes: 2 additions & 2 deletions t/07_builder_integration.t
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ lives_ok {
is($mime3->head->get('From'),'"me" <from2@test.com>'."\n",'From ok');
is($mime3->head->get('Sender'),'"me2" <from3@test.com>'."\n",'From ok');
is($mime3->parts,2,'No. of mime parts ok');
is($mime3->parts(0)->mime_type,'application/pdf','Mime type ok');
is($mime3->parts(1)->mime_type,'text/plain','Mime type ok');
is($mime3->parts(0)->mime_type,'text/plain','Mime type ok');
is($mime3->parts(1)->mime_type,'application/pdf','Mime type ok');

} 'Object 2 ok';

0 comments on commit de66f3b

Please sign in to comment.