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

Issue Type: Bug Created: 2012-02-07T11:34:10.000+0000 Last Updated: 2012-06-13T20:06:15.000+0000 Status: Resolved Fix version(s): Reporter: Mario Dees (mariod) Assignee: Maks 3w (maks3w) Tags: - Zend\Mail

Related issues: - ZF2-185



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.


Posted by Adam Lundrigan (adamlundrigan) on 2012-02-23T14:31:36.000+0000

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

Posted by Mario Dees (mariod) on 2012-02-23T14:42:41.000+0000

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.

Posted by Philipp Kamps (fips) on 2012-05-01T13:30:18.000+0000

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



Posted by Maks 3w (maks3w) on 2012-06-12T16:14:31.000+0000

Probably this PR ( fix this Could someone test it?

Posted by Maks 3w (maks3w) on 2012-06-13T20:06:15.000+0000

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

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.