Class Zend_Mail

Description

Class for sending an email.

  • copyright: Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com)
  • license: New BSD License

Located in /Mail.php (line 61)

Zend_Mime_Message
   |
   --Zend_Mail
Variable Summary
Method Summary
 Zend_Mail __construct ([string $charset = 'iso-8859-1'])
 Zend_Mail addAttachment ( $attachment)
 Zend_Mail addBcc (string $email)
 Zend_Mail addCc (string $email, [string $name = ''])
 Zend_Mail addHeader (string $name, string $value, [boolean $append = false])
 Zend_Mail addTo (string $email, [string $name = ''])
 Zend_Mime_Part createAttachment (string $body, [string $mimeType = Zend_Mime::TYPE_OCTETSTREAM], [string $disposition = Zend_Mime::DISPOSITION_ATTACHMENT], [string $encoding = Zend_Mime::ENCODING_BASE64], [string $filename = null])
 false|Zend_Mime_Part|string getBodyHtml ([bool $htmlOnly = false])
 false|Zend_Mime_Part|string getBodyText ([bool $textOnly = false])
 string getCharset ()
 string getFrom ()
 void getHeaders ()
 string getMimeBoundary ()
 void getPartCount ()
 array getRecipients ()
 string getReturnPath ()
 string getSubject ()
 string getType ()
 Zend_Mail setBodyHtml (string $html, [string $charset = null])
 Zend_Mail setBodyText (string $txt, [string $charset = null])
 Zend_Mail setFrom (string $email, [string $name = ''])
 Zend_Mail setMimeBoundary (string $boundary)
 Zend_Mail setReturnPath (string $email)
 Zend_Mail setSubject (string $subject)
 Zend_Mail setType (string $type)
 void _addRecipient (string $email, [ $to = false])
 void _addRecipientAndHeader (string $headerName, string $name, string $email)
 string _encodeHeader (string $value)
 void _storeHeader (string $headerName, string $value, [boolean $append = false])
Variables
static Zend_Mail_Transport_Abstract $_defaultTransport = null (line 71)
  • access: protected
boolean $hasAttachments = false (line 145)

Flag: whether or not email has attachments

  • access: public
false|Zend_Mime_Part $_bodyHtml = false (line 125)

text/html MIME part

  • access: protected
false|Zend_Mime_Part $_bodyText = false (line 119)

text/plain MIME part

  • access: protected
string $_charset = null (line 77)

Mail character set

  • access: protected
string $_from = null (line 89)

From: address

  • access: protected
array $_headers = array() (line 83)

Mail headers

  • access: protected
string $_mimeBoundary = null (line 131)

MIME boundary string

  • access: protected
array $_recipients = array() (line 101)

Array of all recipients

  • access: protected
string $_returnPath = null (line 107)

Return-Path header

  • access: protected
string $_subject = null (line 113)

Subject: header

  • access: protected
array $_to = array() (line 95)

To: addresses

  • access: protected
string $_type = null (line 137)

Content type of the message

  • access: protected

Inherited Variables

Inherited from Zend_Mime_Message

Zend_Mime_Message::$_mime
Zend_Mime_Message::$_parts
Methods
static setDefaultTransport (line 156)

Sets the default mail transport for all following uses of Zend_Mail::send();

  • todo: Allow passing in optional options for the transport to load
  • todo: Allow passing a string to indicate the transport to load
  • access: public
static void setDefaultTransport (Zend_Mail_Transport_Abstract $transport)
Constructor __construct (line 166)

Public constructor

  • access: public
Zend_Mail __construct ([string $charset = 'iso-8859-1'])
  • string $charset
addAttachment (line 324)

Adds an existing attachment to the mail message

  • return: Provides fluent interface
  • access: public
Zend_Mail addAttachment ( $attachment)
addBcc (line 484)

Adds Bcc recipient

  • return: Provides fluent interface
  • access: public
Zend_Mail addBcc (string $email)
  • string $email
addCc (line 472)

Adds Cc-header and recipient

  • return: Provides fluent interface
  • access: public
Zend_Mail addCc (string $email, [string $name = ''])
  • string $name
  • string $email
addHeader (line 602)

Add a custom header to the message

  • return: Provides fluent interface
  • throws: Zend_Mail_Exception on attempts to create standard headers
  • access: public
Zend_Mail addHeader (string $name, string $value, [boolean $append = false])
  • string $name
  • string $value
  • boolean $append
addTo (line 459)

Adds To-header and recipient

  • return: Provides fluent interface
  • access: public
Zend_Mail addTo (string $email, [string $name = ''])
  • string $name
  • string $email
createAttachment (line 346)

Creates a Zend_Mime_Part attachment

Attachment is automatically added to the mail object after creation. The attachment object is returned to allow for further manipulation.

  • return: Newly created Zend_Mime_Part object (to allow advanced settings)
  • access: public
Zend_Mime_Part createAttachment (string $body, [string $mimeType = Zend_Mime::TYPE_OCTETSTREAM], [string $disposition = Zend_Mime::DISPOSITION_ATTACHMENT], [string $encoding = Zend_Mime::ENCODING_BASE64], [string $filename = null])
  • string $body
  • string $mimeType
  • string $disposition
  • string $encoding
  • string $filename: OPTIONAL A filename for the attachment
getBodyHtml (line 308)

Return Zend_Mime_Part representing body HTML

  • access: public
false|Zend_Mime_Part|string getBodyHtml ([bool $htmlOnly = false])
  • bool $htmlOnly: Whether to return the body HTML only, or the MIME part; defaults to false, the MIME part
getBodyText (line 268)

Return text body Zend_Mime_Part or string

  • access: public
false|Zend_Mime_Part|string getBodyText ([bool $textOnly = false])
  • bool $textOnly: textOnly Whether to return just the body text content or the MIME part; defaults to false, the MIME part
getCharset (line 176)

Return charset string

  • access: public
string getCharset ()
getFrom (line 525)

Returns the sender of the mail

  • access: public
string getFrom ()
getHeaders (line 618)

Return mail headers

  • access: public
void getHeaders ()
getMimeBoundary (line 233)

Return the boundary string used for the message

  • access: public
string getMimeBoundary ()
getPartCount (line 369)

Return a count of message parts

  • access: public
void getPartCount ()
getRecipients (line 495)

Return list of recipient email addresses

  • return: (of strings)
  • access: public
array getRecipients ()
getReturnPath (line 556)

Returns the current Return-Path address for the email

If no Return-Path header is set, returns the value of $_from.

  • access: public
string getReturnPath ()
getSubject (line 588)

Returns the encoded subject of the message

  • access: public
string getSubject ()
getType (line 210)

Get content type of the message

  • access: public
string getType ()
send (line 631)

Sends this email using the given transport or a previously set DefaultTransport or the internal mail function if no default transport had been set.

  • return: Provides fluent interface
  • access: public
Zend_Mail send ([Zend_Mail_Transport_Abstract $transport = null])
setBodyHtml (line 285)

Sets the HTML body for the message

  • return: Provides fluent interface
  • access: public
Zend_Mail setBodyHtml (string $html, [string $charset = null])
  • string $html
  • string $charset
setBodyText (line 245)

Sets the text body for the message.

  • return: Provides fluent interface
  • access: public
Zend_Mail setBodyText (string $txt, [string $charset = null])
  • string $txt
  • string $charset
setFrom (line 508)

Sets From-header and sender of the message

  • return: Provides fluent interface
  • throws: Zend_Mail_Exception if called subsequent times
  • access: public
Zend_Mail setFrom (string $email, [string $name = ''])
  • string $email
  • string $name
setMimeBoundary (line 223)

Set an arbitrary mime boundary for the message

If not set, Zend_Mime will generate one.

  • return: Provides fluent interface
  • access: public
Zend_Mail setMimeBoundary (string $boundary)
  • string $boundary
setReturnPath (line 537)

Sets the Return-Path header for an email

  • return: Provides fluent interface
  • throws: Zend_Mail_Exception if set multiple times
  • access: public
Zend_Mail setReturnPath (string $email)
  • string $email
setSubject (line 571)

Sets the subject of the message

  • return: Provides fluent interface
  • access: public
Zend_Mail setSubject (string $subject)
  • string $subject
setType (line 190)

Set content type

Should only be used for manually setting multipart content types.

  • return: Implements fluent interface
  • throws: Zend_Mail_Exception for types not supported by Zend_Mime
  • access: public
Zend_Mail setType (string $type)
  • string $type: Content type
_addRecipient (line 424)

Add a recipient

  • access: protected
void _addRecipient (string $email, [ $to = false])
  • string $email
  • $to
_addRecipientAndHeader (line 441)

Helper function for adding a recipient and the corresponding header

  • access: protected
void _addRecipientAndHeader (string $headerName, string $name, string $email)
  • string $headerName
  • string $name
  • string $email
_encodeHeader (line 383)

Encode header fields

Encodes header content according to RFC1522 if it contains non-printable characters.

  • access: protected
string _encodeHeader (string $value)
  • string $value
_storeHeader (line 404)

Add a header to the message

Adds a header to this message. If append is true and the header already exists, raises a flag indicating that the header should be appended.

  • access: protected
void _storeHeader (string $headerName, string $value, [boolean $append = false])
  • string $headerName
  • string $value
  • boolean $append

Inherited Methods

Inherited From Zend_Mime_Message

 Zend_Mime_Message::addPart()
 Zend_Mime_Message::createFromMessage()
 Zend_Mime_Message::generateMessage()
 Zend_Mime_Message::getMime()
 Zend_Mime_Message::getPartContent()
 Zend_Mime_Message::getPartHeaders()
 Zend_Mime_Message::getPartHeadersArray()
 Zend_Mime_Message::getParts()
 Zend_Mime_Message::isMultiPart()
 Zend_Mime_Message::setMime()
 Zend_Mime_Message::setParts()
 Zend_Mime_Message::_disassembleMime()

Documentation generated on Sun, 27 May 2007 23:25:33 -0700 by phpDocumentor 1.3.2