Zend Framework

Zend_Mail - 20.6. Attachments > false method addAttachment() used

Details

  • Type: Docs:  Problem Docs: Problem
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.0.0 RC2
  • Component/s: Zend_Mail
  • Labels:
    None
  • Language:
    English

Description

The documentation of the Attachments in Zend_Mail is mainly about the addAttachment() method whereas it should be the createAttachment() method.
If you look at addAttachment in Zend/Mail.php you'll see that the argument should be a Zend_Mime_Part object.

public function addAttachment(Zend_Mime_Part $attachment)

{ $this->addPart($attachment); $this->hasAttachments = true; return $this; }

But the documentation says that it should a binary string "$mail->addAttachment($myImage, 'image/gif', Zend_Mime::DISPOSITION_INLINE, Zend_Mime::ENCODING_8BIT);". These arguments match to the createAttachment() method and therefore this should be used instead of the addAttachment() in the documentation.

public function createAttachment($body,
$mimeType = Zend_Mime::TYPE_OCTETSTREAM,
$disposition = Zend_Mime::DISPOSITION_ATTACHMENT,
$encoding = Zend_Mime::ENCODING_BASE64,
$filename = null)

{ $mp = new Zend_Mime_Part($body); $mp->encoding = $encoding; $mp->type = $mimeType; $mp->disposition = $disposition; $mp->filename = $filename; $this->addAttachment($mp); return $mp; }

Activity

Hide
Bill Karwin added a comment -

Assigning to Nico.

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

Thanks for the report. The method got renamed for the fluent interface, doc is now correct.

Show
Nico Edtinger added a comment - Thanks for the report. The method got renamed for the fluent interface, doc is now correct.
Hide
Wil Sinclair added a comment -

Updating to comply with new IT component conventions.

Show
Wil Sinclair added a comment - Updating to comply with new IT component conventions.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: