Zend Framework

Zend_Mail Should Allow Users to Specifiy MIME Part Parameters

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 0.8.0
  • Fix Version/s: 1.0.0 RC2
  • Component/s: Zend_Mail
  • Labels:
    None

Description

Zend_Mail::setBodyText() currently only allows a specific type of MIME part to be set. Users should be able to define parameters for the MIME part. For example, users should be able to set the encoding to 7bit, instead of the default QUOTEDPRINTABLE.

Perhaps setBodyText() should optionally accept an instance of Zend_Mime_Part?

  1. Accept_Mime_Part.diff
    26/Feb/07 2:06 PM
    0.7 kB
    Gregory Szorc
  2. Encoding_Parameter.diff
    26/Feb/07 2:11 PM
    0.9 kB
    Gregory Szorc

Activity

Hide
Nico Edtinger added a comment -

But setBodyText() already returns the instance it creates. You could even use fluent interfaces to change the encoding type:

$mail->setBodyText('your body')->encoding = Zend_Mime::ENCODING_7BIT;

Or is this to complicated?

Show
Nico Edtinger added a comment - But setBodyText() already returns the instance it creates. You could even use fluent interfaces to change the encoding type: $mail->setBodyText('your body')->encoding = Zend_Mime::ENCODING_7BIT; Or is this to complicated?
Hide
Gregory Szorc added a comment -

Accept first parameter to setBodyText() to be instance of Zend_Mime_Part

Show
Gregory Szorc added a comment - Accept first parameter to setBodyText() to be instance of Zend_Mime_Part
Hide
Gregory Szorc added a comment -

This patch adds an $encoding parameter to setBodyText() that allows user to override the default encoding of ENCODING_QUOTEDPRINTABLE

Show
Gregory Szorc added a comment - This patch adds an $encoding parameter to setBodyText() that allows user to override the default encoding of ENCODING_QUOTEDPRINTABLE
Hide
Gregory Szorc added a comment -

Nico, you are right. I don't know how I missed that.

The addition of an encoding parameter is simple, and might make the method more intuitive. After all, the only two properties of Zend_Mime_Part that would ever need to be modified for setBodyText() are the encoding and charset.

Some documentation under getBodyText() reminding people that the variable is passed by reference might also go a long way.

Show
Gregory Szorc added a comment - Nico, you are right. I don't know how I missed that. The addition of an encoding parameter is simple, and might make the method more intuitive. After all, the only two properties of Zend_Mime_Part that would ever need to be modified for setBodyText() are the encoding and charset. Some documentation under getBodyText() reminding people that the variable is passed by reference might also go a long way.
Hide
Bill Karwin added a comment -

Assign to Nico.

Show
Bill Karwin added a comment - Assign to Nico.
Hide
Nico Edtinger added a comment -

Encoding can be changed via the third parameter in setBodyText() and setBodyHtml().

Show
Nico Edtinger added a comment - Encoding can be changed via the third parameter in setBodyText() and setBodyHtml().

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: