ZF2-154: Message will send with an empty body if only a single mime message body part is assigned

Description

Sending a message that has setBody used with a string, or using a mime message with just a single body part will result in a message with an empty body all together.

Comments

Can you please provide a simple example which reproduces your issue?

I actually tested some more and it came down that it only did this with a specific mail server (smtp.1and1.com), the same code works just fine now with Postfix on localhost, I tried it not just with sendmail, but also the smtp adapter and it's okay. However zf1 type mail handling worked fine with 1and1 mail servers, so there must be something that fails during smtp communication with zf2 and those servers.

I can confirm that there are some problems around sending emails over different mail servers. Sometimes I end up receiving correct emails and sometimes (on different networks with a different mail delivery setups) I only receive broken messages. Here an example:

Delivered-To: name@domain.com Received: by 10.52.165.162 with SMTP id yz2csp102219vdb; Tue, 1 May 2012 03:14:08 -0700 (PDT) Received: by 10.14.119.197 with SMTP id n45mr4834496eeh.46.1335867248014; Tue, 01 May 2012 03:14:08 -0700 (PDT) Return-Path: name@domain.com Received: from localhost ([77.88.66.165]) by mx.google.com with ESMTP id p48si5709352eef.113.2012.05.01.03.14.06; Tue, 01 May 2012 03:14:07 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning name@domain.com does not designate 77.88.66.165 as permitted sender) client-ip=77.88.66.165; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning name@name.com does not designate 77.88.66.165 as permitted sender) smtp.mail=name@domain.com Message-Id: 4f9fb76f.c85f0e0a.124c.ffffb0beSMTPIN_ADDED@mx.google.com Received: by localhost (Postfix, from userid 501) id 0756A179953E; Tue, 1 May 2012 12:13:47 +0200 (CEST) To: name@domain.com Subject: Daily History X-PHP-Originating-Script: 501:Sendmail.php Date: Tue, 01 May 2012 12:13:47 +0200

From: Philipp Kamps name@domain.com

Subject: Daily History

Mime-Version: 1.0

Content-Type: multipart/mixed;

boundary="=_205e18960d7aaeee08a8cd6d7880a407" Message-Id: <20120501101349.0756A179953E@localhost>

This is a message in Mime Format. If you see this, your mail reader does not support this format.

--=_205e18960d7aaeee08a8cd6d7880a407 Content-Type: text/plain Content-Transfer-Encoding: 8bit

Please see attachment. --=_205e18960d7aaeee08a8cd6d7880a407 Content-Type: text/csv Content-Transfer-Encoding: 8bit

--=_205e18960d7aaeee08a8cd6d7880a407 Content-Type: text/csv Content-Transfer-Encoding: 8bit

.BUNLIL1 .DBCDIX .DBODIX2 .DGLDIX .JGBLIL1 .JGBSIL1 DFPINDEX testbench5

--=_205e18960d7aaeee08a8cd6d7880a407--

Probably this PR (https://github.com/zendframework/zf2/pull/1475) fix this Could someone test it?

The PR has been merged, if the issue persists please reopen the issue.