ZF-6263: Bug in Zend_Mail subject in case of special charachters (ZF-2559 not fixed)

Issue Type: Bug Created: 2009-04-10T13:03:14.000+0000 Last Updated: 2009-06-12T13:19:09.000+0000 Status: Resolved Fix version(s): - 1.9.0 (31/Jul/09)

Reporter: Gijs Stijnman (spintop) Assignee: Benjamin Eberlei (beberlei) Tags: - Zend_Mail

Related issues: - ZF-2559

Attachments: - mailtest.php


The following strings:

"Bekræftigelse af reservation med Goopoint Online Appointments den 16-04-2009 kl. 09:00." and "Bekræftigelse af reservation med den 24-04-2009 kl. 09:00."

Are set as the subject by Zend_Mail::setSubject();

When the e-mail is sent, they come out with unwanted extra spaces (after 09: and Fullxml.):

"Bekræftigelse af reservation med Goopoint Online Appointments den 16-04-2009 kl. 09: 00." and "Bekræftigelse af reservation med Fullxml. dk den 24-04-2009 kl. 09:00."

If the special character 'æ' is changed in 'a' then the spaces are gone. Hope this can be fixed.


Posted by old of Satoru Yoshida ( on 2009-04-10T14:18:42.000+0000

This issue needs more informations.

For example, encoding of your string. it is ISO-8859-1 ? I do not know what language you use. use or not setHeaderEncoding() .

Posted by Gijs Stijnman (spintop) on 2009-04-14T01:28:33.000+0000

Dear Satoru Yoshida,

Here the answers to your questions:

The encoding is standard (ISO-8859-1) The language is Danish (but why is that important, it is about the character string I think) setHeaderEncoding isn't used, see the php code below:

This is the code when the problem occurs:

setSubject('Bekræftigelse af reservation med Goopoint Online Appointments den 16-04-2009 kl. 09:00.'); $mail->setBodyText('Test'); $mail->addTo(''); $mail->send(); ?>

Posted by Benjamin Eberlei (beberlei) on 2009-06-12T13:19:09.000+0000

Committed Fix to trunk.

Changed Zend_Mime::encodeQuotedPrintableHeader() again to only break at spaces. This is the only possible way to ensure in every setup that headers are displayed correctly in many different mail-clients when they are broken into several lines.

If problems occur with too long headers, because no spaces occur please use Base64 Encoding, which does not suffer from this problems.

Have you found an issue?

See the Overview section for more details.


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

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