Class Zend_Mail

Description

Class for sending an email.

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

Located in /Mail.php (line 52)

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])
 string createMessageId ()
 false|Zend_Mime_Part|string getBodyHtml ([bool $htmlOnly = false])
 false|Zend_Mime_Part|string getBodyText ([bool $textOnly = false])
 string getCharset ()
 string getDate ()
 string getFrom ()
 string getHeaderEncoding ()
 void getHeaders ()
 string getMessageId ()
 string getMimeBoundary ()
 integer getPartCount ()
 array getRecipients ()
 string getReturnPath ()
 string getSubject ()
 string getType ()
 Zend_Mail setBodyHtml (string $html, [string $charset = null], [string $encoding = Zend_Mime::ENCODING_QUOTEDPRINTABLE])
 Zend_Mail setBodyText (string $txt, [string $charset = null], [string $encoding = Zend_Mime::ENCODING_QUOTEDPRINTABLE])
 Zend_Mail setDate ([string $date = null])
 Zend_Mail setEncodingOfHeaders (string $encoding)
 Zend_Mail setFrom (string $email, [string $name = null])
 Zend_Mail setHeaderEncoding (string $encoding)
 Zend_Mail setMessageId ([boolean|string $id = true])
 Zend_Mail setMimeBoundary (string $boundary)
 Zend_Mail setReplyTo (string $email, [string $name = null])
 Zend_Mail setReturnPath (string $email)
 Zend_Mail setSubject (string $subject)
 Zend_Mail setType (string $type)
 void _addRecipientAndHeader (string $headerName, string $email, string $name)
 void _clearHeader (string $headerName)
 string _encodeHeader (string $value)
 string _filterEmail (string $email)
 string _filterName (string $name)
 string _filterOther (string $data)
 string _formatAddress (string $email, string $name)
 void _storeHeader (string $headerName, string $value, [bool $append = false])
Variables
static Zend_Mail_Transport_Abstract $_defaultTransport = null (line 62)
  • access: protected
boolean $hasAttachments = false (line 154)

Flag: whether or not email has attachments

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

text/html MIME part

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

text/plain MIME part

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

Mail character set

  • access: protected
string $_date = null (line 116)

Date: header

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

From: address

  • access: protected
string $_headerEncoding = Zend_Mime::ENCODING_QUOTEDPRINTABLE (line 80)

Encoding of Mail headers

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

Mail headers

  • access: protected
string $_messageId = null (line 122)

Message-ID: header

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

MIME boundary string

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

Array of all recipients

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

Return-Path header

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

Subject: header

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

To: addresses

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

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 165)

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 175)

Public constructor

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

Adds an existing attachment to the mail message

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

Adds Bcc recipient

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

Adds Cc-header and recipient

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

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 531)

Adds To-header and recipient

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

Clears the formatted date from the message

  • return: Provides fluent interface
  • access: public
Zend_Mail clearDate ()
clearFrom (line 643)

Clears the sender from the mail

  • return: Provides fluent interface
  • access: public
Zend_Mail clearFrom ()
clearMessageId (line 869)

Clears the Message-ID from the message

  • return: Provides fluent interface
  • access: public
Zend_Mail clearMessageId ()
clearRecipients (line 578)

Clears list of recipient email addresses

  • return: Provides fluent interface
  • access: public
Zend_Mail clearRecipients ()
clearReturnPath (line 695)

Clears the current Return-Path address from the message

  • return: Provides fluent interface
  • access: public
Zend_Mail clearReturnPath ()
clearSubject (line 741)

Clears the encoded subject from the message

  • return: Provides fluent interface
  • access: public
Zend_Mail clearSubject ()
createAttachment (line 422)

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
createMessageId (line 882)

Creates the Message-ID

  • access: public
string createMessageId ()
getBodyHtml (line 384)

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 343)

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 185)

Return charset string

  • access: public
string getCharset ()
getDate (line 801)

Returns the formatted date of the message

  • access: public
string getDate ()
getEncodingOfHeaders (line 259)

Return encoding of mail headers

string getEncodingOfHeaders ()
getFrom (line 633)

Returns the sender of the mail

  • access: public
string getFrom ()
getHeaderEncoding (line 271)

Return the encoding of mail headers

Either Zend_Mime::ENCODING_QUOTEDPRINTABLE or Zend_Mime::ENCODING_BASE64

  • access: public
string getHeaderEncoding ()
getHeaders (line 945)

Return mail headers

  • access: public
void getHeaders ()
getMessageId (line 858)

Returns the Message-ID of the message

  • access: public
string getMessageId ()
getMimeBoundary (line 248)

Return the boundary string used for the message

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

Return a count of message parts

  • access: public
integer getPartCount ()
getRecipients (line 568)

Return list of recipient email addresses

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

Returns the current Return-Path address of the message

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

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

Returns the encoded subject of the message

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

Get content type of the message

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

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 361)

Sets the HTML body for the message

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

Sets the text body for the message.

  • return: Provides fluent interface
  • access: public
Zend_Mail setBodyText (string $txt, [string $charset = null], [string $encoding = Zend_Mime::ENCODING_QUOTEDPRINTABLE])
  • string $txt
  • string $charset
  • string $encoding
setDate (line 756)

Sets Date-header

  • return: Provides fluent interface
  • throws: Zend_Mail_Exception if called subsequent times
  • access: public
Zend_Mail setDate ([string $date = null])
  • string $date
setEncodingOfHeaders (line 283)

Set the encoding of mail headers

Zend_Mail setEncodingOfHeaders (string $encoding)
  • string $encoding
setFrom (line 598)

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 = null])
  • string $email
  • string $name
setHeaderEncoding (line 294)

Set the encoding of mail headers

  • return: Provides fluent interface
  • access: public
Zend_Mail setHeaderEncoding (string $encoding)
  • string $encoding: Zend_Mime::ENCODING_QUOTEDPRINTABLE or Zend_Mime::ENCODING_BASE64
setMessageId (line 830)

Sets the Message-ID of the message

  • return: Provides fluent interface
  • throws: Zend_Mail_Exception
  • access: public
Zend_Mail setMessageId ([boolean|string $id = true])
  • boolean|string $id: true :Auto false :No set null :No set string:Sets string
setMimeBoundary (line 236)

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
setReplyTo (line 622)

Set Reply-To Header

  • access: public
Zend_Mail setReplyTo (string $email, [string $name = null])
  • string $email
  • string $name
setReturnPath (line 658)

Sets the Return-Path header of the message

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

Sets the subject of the message

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

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
_addRecipientAndHeader (line 515)

Helper function for adding a recipient and the corresponding header

  • access: protected
void _addRecipientAndHeader (string $headerName, string $email, string $name)
  • string $headerName
  • string $email
  • string $name
_clearHeader (line 501)

Clear header from the message

  • access: protected
void _clearHeader (string $headerName)
  • string $headerName
_encodeHeader (line 459)

Encode header fields

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

  • access: protected
string _encodeHeader (string $value)
  • string $value
_filterEmail (line 984)

Filter of email data

  • access: protected
string _filterEmail (string $email)
  • string $email
_filterName (line 1004)

Filter of name data

  • access: protected
string _filterName (string $name)
  • string $name
_filterOther (line 1023)

Filter of other data

  • access: protected
string _filterOther (string $data)
  • string $data
_formatAddress (line 1040)

Formats e-mail address

  • access: protected
string _formatAddress (string $email, string $name)
  • string $email
  • string $name
_storeHeader (line 482)

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, [bool $append = false])
  • string $headerName
  • string $value
  • bool $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 Thu, 01 Apr 2010 13:13:38 -0400 by phpDocumentor 1.4.3