ZF-1795: Corrupted Attachments


I am having troubled with attachments when sending to AT&T (Cingular) MM3 Email-to-MMS gateway via SMTP. Unfortunately the gateway's software is a black box to me, but the result that it "removed corrupted mime part image/jpeg".

$mail->createAttachment($data['image'], 'image/jpeg', Zend_Mime::DISPOSITION_INLINE, Zend_Mime::ENCODING_BASE64, $message->id."-img.jpg");

$data['image'] is the result of imagejpeg().

All this works really well with PEAR::Mail. I have played around with changing line end characters and changing the line length, but it does not solve anything.

Mail.app on Mac and Outlook on Windows can read the attachments, but when I save it from Exchange Webmail, it seems a little corrupted too (maybe because that front-end is not that smart to correct errors.)

Something seems fishy in Zend_Mime or Zend_Mail_Smtp and I cannot figure it out.


Assigning to [~matthew] to initiate issue review.

Assigning to Nico

The problem seems to occur not always but rather sporadically. Unfortunately I cannot say under which circumstances the attachment gets corrupted. When I run the very same code several times, most of the times everything works as expected, but sometimes the attachment is broken. Hope this helps.

Fixed with r12343. Changed linelength to 72 to be compatible with other mailers.

Seems to be related to ZF-4360 and ZF-4169. Feel free to reopen if it is not fixed for your environment.

Changing issues in preparation for the 1.7.0 release.