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


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.


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 (, 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: Received: by with SMTP id yz2csp102219vdb; Tue, 1 May 2012 03:14:08 -0700 (PDT) Received: by with SMTP id n45mr4834496eeh.46.1335867248014; Tue, 01 May 2012 03:14:08 -0700 (PDT) Return-Path: Received: from localhost ([]) by with ESMTP id p48si5709352eef.113.2012.; Tue, 01 May 2012 03:14:07 -0700 (PDT) Received-SPF: softfail ( domain of transitioning does not designate as permitted sender) client-ip=; Authentication-Results:; spf=softfail ( domain of transitioning does not designate as permitted sender) Message-Id: Received: by localhost (Postfix, from userid 501) id 0756A179953E; Tue, 1 May 2012 12:13:47 +0200 (CEST) To: Subject: Daily History X-PHP-Originating-Script: 501:Sendmail.php Date: Tue, 01 May 2012 12:13:47 +0200

From: Philipp Kamps

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



Probably this PR ( fix this Could someone test it?

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