views:

25

answers:

2

In the example for Zend_Mail on http://framework.zend.com/manual/en/zend.mail.attachments.html they use ENCODING_8BIT but searching for what that might be sends me to http://msdn.microsoft.com/en-us/library/ms526992%28EXCHG.10%29.aspx were (and this sounds logical to me) it is explained that 8bit encoding does not make sense for emails.

Edit:

In which cases does it make sense to use ENCODING_8BIT?

A: 

Not for email but for attachements. If you take a look on the RFC 2045 at page 7:

RFC2045

"Binary data" refers to data where any sequence of octets whatsoever is allowed.

ArneRie
Mh, the RFC is not much clearer. I attached a binary file (800 KB) as 8bit and it seems to corrupt the file. I am using base64 now instead. I am still confused about what would be the practical use case for 8bit?
Alex
A: 

Zend_Mime::ENCODING_8BIT sets the Content-Transfer-Encoding.
The Content-Transfer-Encoding defines methods for representing binary data in ASCII text format.
The use of Zend_Mime::ENCODING_8BIT in the example is a Bug.

For sending Attachments you should always use Zend_Mime::ENCODING_BASE64

Benjamin Cremer
Yes but as written below this leads to a mail with corrupted attachment. So what is the practical use for this setting?
Alex