Class Zend_Mail

Description

Class for sending an email.

  • copyright: Copyright (c) 2005-2010 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
 static void clearDefaultFrom ()
 static void clearDefaultReplyTo ()
 static void clearDefaultTransport ()
 static null|array getDefaultFrom ()
 static null|array getDefaultReplyTo ()
 static void getDefaultTransport ()
 static void setDefaultFrom (string $email, [string $name = null])
 static void setDefaultReplyTo (string $email, [string $name = null])
 Zend_Mail __construct ([string $charset = 'iso-8859-1'])
 Zend_Mail addAttachment ( $attachment)
 Zend_Mail addBcc (string|array $email)
 Zend_Mail addCc (string|array $email, [string $name = ''])
 Zend_Mail addHeader (string $name, string $value, [boolean $append = false])
 Zend_Mail addTo (string|array $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|null getReplyTo ()
 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 ([timestamp|string|Zend_Date $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 array $_defaultFrom (line 68)
  • access: protected
static array $_defaultReplyTo (line 74)
  • access: protected
static Zend_Mail_Transport_Abstract $_defaultTransport = null (line 62)
  • access: protected
boolean $hasAttachments = false (line 172)

Flag: whether or not email has attachments

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

text/html MIME part

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

text/plain MIME part

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

Mail character set

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

Date: header

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

From: address

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

Encoding of Mail headers

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

Mail headers

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

Message-ID: header

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

MIME boundary string

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

Array of all recipients

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

Reply-To header

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

Return-Path header

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

Subject: header

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

To: addresses

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

Content type of the message

  • access: protected

Inherited Variables

Inherited from Zend_Mime_Message

Zend_Mime_Message::$_mime
Zend_Mime_Message::$_parts
Methods
static clearDefaultFrom (line 774)

Clears the default sender from the mail

  • access: public
static void clearDefaultFrom ()
static clearDefaultReplyTo (line 824)

Clears the default ReplyTo-address and -name from the mail

  • access: public
static void clearDefaultReplyTo ()
static clearDefaultTransport (line 203)

Clear the default transport property

  • access: public
static void clearDefaultTransport ()
static getDefaultFrom (line 764)

Returns the default sender of the mail

  • return: Null if none was set.
  • access: public
static null|array getDefaultFrom ()
static getDefaultReplyTo (line 814)

Returns the default Reply-To Address and Name of the mail

  • return: Null if none was set.
  • access: public
static null|array getDefaultReplyTo ()
static getDefaultTransport (line 195)

Gets the default mail transport for all following uses of unittests

  • 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 getDefaultTransport ()
static setDefaultFrom (line 754)

Sets Default From-email and name of the message

  • access: public
static void setDefaultFrom (string $email, [string $name = null])
  • string $email
  • string $name: Optional $name
static setDefaultReplyTo (line 804)

Sets Default ReplyTo-address and -name of the message

  • access: public
static void setDefaultReplyTo (string $email, [string $name = null])
  • string $email
  • string $name: Optional $name
static setDefaultTransport (line 183)

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

Public constructor

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

Adds an existing attachment to the mail message

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

Adds Bcc recipient, $email can be an array, or a single string address

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

Adds Cc-header and recipient, $email can be an array, or a single string address

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

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

Adds To-header and recipient, $email can be an array, or a single string address

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

Clears the formatted date from the message

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

Clears the sender from the mail

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

Clears the Message-ID from the message

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

Clears list of recipient email addresses

  • return: Provides fluent interface
  • access: public
Zend_Mail clearRecipients ()
clearReplyTo (line 739)

Clears the current Reply-To address from the message

  • return: Provides fluent interface
  • access: public
Zend_Mail clearReplyTo ()
clearReturnPath (line 891)

Clears the current Return-Path address from the message

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

Clears the encoded subject from the message

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

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

Creates the Message-ID

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

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

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

Return charset string

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

Returns the formatted date of the message

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

Return encoding of mail headers

string getEncodingOfHeaders ()
getFrom (line 706)

Returns the sender of the mail

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

Return the encoding of mail headers

Either Zend_Mime::ENCODING_QUOTEDPRINTABLE or Zend_Mime::ENCODING_BASE64

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

Return mail headers

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

Returns the Message-ID of the message

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

Return the boundary string used for the message

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

Return a count of message parts

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

Return list of recipient email addresses

  • return: (of strings)
  • access: public
array getRecipients ()
getReplyTo (line 716)

Returns the current Reply-To address of the message

  • return: Reply-To address, null when not set
  • access: public
string|null getReplyTo ()
getReturnPath (line 877)

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

Returns the encoded subject of the message

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

Get content type of the message

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

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

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

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

Sets Date-header

  • return: Provides fluent interface
  • throws: Zend_Mail_Exception if called subsequent times or wrong date format.
  • access: public
Zend_Mail setDate ([timestamp|string|Zend_Date $date = null])
setEncodingOfHeaders (line 321)

Set the encoding of mail headers

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

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
setFromToDefaultFrom (line 784)

Sets From-name and -email based on the defaults

  • return: Provides fluent interface
  • access: public
Zend_Mail setFromToDefaultFrom ()
setHeaderEncoding (line 332)

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

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 given string (Angle brackets is not necessary)
setMimeBoundary (line 274)

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

Set Reply-To Header

  • throws: Zend_Mail_Exception if called more than one time
  • access: public
Zend_Mail setReplyTo (string $email, [string $name = null])
  • string $email
  • string $name
setReplyToFromDefault (line 834)

Sets ReplyTo-name and -email based on the defaults

  • return: Provides fluent interface
  • access: public
Zend_Mail setReplyToFromDefault ()
setReturnPath (line 854)

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

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

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

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

Clear header from the message

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

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

Filter of email data

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

Filter of name data

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

Filter of other data

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

Formats e-mail address

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

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 Mon, 21 Jun 2010 15:32:07 -0400 by phpDocumentor 1.4.3