Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Class for sending an email.
false|Zend_Mime_Part $_bodyHtml = 'false'
text/html MIME part
false|Zend_Mime_Part $_bodyText = 'false'
text/plain MIME part
string $_charset = 'null'
Mail character set
string $_date = 'null'
Date: header
array $_defaultFrom = ''
array $_defaultReplyTo = ''
Zend_Mail_Transport_Abstract $_defaultTransport = 'null'
string $_from = 'null'
From: address
string $_headerEncoding = 'Zend_Mime'
Encoding of Mail headers
array $_headers = 'array'
Mail headers
string $_messageId = 'null'
Message-ID: header
string $_mimeBoundary = 'null'
MIME boundary string
array $_recipients = 'array'
Array of all recipients
string $_replyTo = 'null'
Reply-To header
string $_returnPath = 'null'
Return-Path header
string $_subject = 'null'
Subject: header
array $_to = 'array'
To: addresses
string $_type = 'null'
Content type of the message
boolean $hasAttachments = 'false'
Flag: whether or not email has attachments
__construct(
string $charset
=
iso-8859-1
)
:
Public constructor
_addRecipientAndHeader(
string $headerName, string $email, string $name
)
:
Helper function for adding a recipient and the corresponding header
_clearHeader(
string $headerName
)
:
Clear header from the message
_encodeHeader(
string $value
)
:
string
Encode header fields
Encodes header content according to RFC1522 if it contains non-printable characters.
_filterEmail(
string $email
)
:
string
Filter of email data
_filterName(
string $name
)
:
string
Filter of name data
_filterOther(
string $data
)
:
string
Filter of other data
_formatAddress(
string $email, string $name
)
:
string
Formats e-mail address
_storeHeader(
string $headerName, string $value, bool $append
=
false
)
:
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.
addAttachment(
Zend_Mime_Part $attachment
)
:
Zend_Mail
Adds an existing attachment to the mail message
addBcc(
string|array $email
)
:
Zend_Mail
Adds Bcc recipient, $email can be an array, or a single string address
addCc(
string|array $email, string $name
)
:
Zend_Mail
Adds Cc-header and recipient, $email can be an array, or a single string address
addHeader(
string $name, string $value, boolean $append
=
false
)
:
Zend_Mail
Add a custom header to the message
addTo(
string|array $email, string $name
)
:
Zend_Mail
Adds To-header and recipient, $email can be an array, or a single string address
clearDate(
)
:
Zend_Mail
Clears the formatted date from the message
clearDefaultFrom(
)
:
void
Clears the default sender from the mail
clearDefaultReplyTo(
)
:
void
Clears the default ReplyTo-address and -name from the mail
clearDefaultTransport(
)
:
Clear the default transport property
clearFrom(
)
:
Zend_Mail
Clears the sender from the mail
clearMessageId(
)
:
Zend_Mail
Clears the Message-ID from the message
clearRecipients(
)
:
Zend_Mail
Clears list of recipient email addresses
clearReplyTo(
)
:
Zend_Mail
Clears the current Reply-To address from the message
clearReturnPath(
)
:
Zend_Mail
Clears the current Return-Path address from the message
clearSubject(
)
:
Zend_Mail
Clears the encoded subject from the message
createAttachment(
string $body, string $mimeType
=
Zend_Mime, string $disposition
=
Zend_Mime, string $encoding
=
Zend_Mime, string $filename
=
null
)
:
Zend_Mime_Part
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.
createMessageId(
)
:
string
Creates the Message-ID
getBodyHtml(
bool $htmlOnly
=
false
)
:
false|Zend_Mime_Part|string
Return Zend_Mime_Part representing body HTML
getBodyText(
bool $textOnly
=
false
)
:
false|Zend_Mime_Part|string
Return text body Zend_Mime_Part or string
getCharset(
)
:
string
Return charset string
getDate(
)
:
string
Returns the formatted date of the message
getDefaultFrom(
)
:
null|array
Returns the default sender of the mail
getDefaultReplyTo(
)
:
null|array
Returns the default Reply-To Address and Name of the mail
getDefaultTransport(
)
:
Gets the default mail transport for all following uses of unittests
getEncodingOfHeaders(
)
:
string
Return encoding of mail headers
getFrom(
)
:
string
Returns the sender of the mail
getHeaderEncoding(
)
:
string
Return the encoding of mail headers
Either Zend_Mime::ENCODING_QUOTEDPRINTABLE or Zend_Mime::ENCODING_BASE64
getHeaders(
)
:
void
Return mail headers
getMessageId(
)
:
string
Returns the Message-ID of the message
getMimeBoundary(
)
:
string
Return the boundary string used for the message
getPartCount(
)
:
integer
Return a count of message parts
getRecipients(
)
:
array
Return list of recipient email addresses
getReplyTo(
)
:
string|null
Returns the current Reply-To address of the message
getReturnPath(
)
:
string
Returns the current Return-Path address of the message
If no Return-Path header is set, returns the value of {@link $_from}.
getSubject(
)
:
string
Returns the encoded subject of the message
getType(
)
:
string
Get content type of the message
send(
Zend_Mail_Transport_Abstract $transport
=
null
)
:
Zend_Mail
Sends this email using the given transport or a previously set DefaultTransport or the internal mail function if no default transport had been set.
setBodyHtml(
string $html, string $charset
=
null, string $encoding
=
Zend_Mime
)
:
Zend_Mail
Sets the HTML body for the message
setBodyText(
string $txt, string $charset
=
null, string $encoding
=
Zend_Mime
)
:
Zend_Mail
Sets the text body for the message.
setDate(
timestamp|string|Zend_Date $date
=
null
)
:
Zend_Mail
Sets Date-header
setDefaultFrom(
string $email, string $name
=
null
)
:
void
Sets Default From-email and name of the message
setDefaultReplyTo(
string $email, string $name
=
null
)
:
void
Sets Default ReplyTo-address and -name of the message
setDefaultTransport(
Zend_Mail_Transport_Abstract $transport
)
:
Sets the default mail transport for all following uses of Zend_Mail::send();
setEncodingOfHeaders(
string $encoding
)
:
Zend_Mail
Set the encoding of mail headers
setFrom(
string $email, string $name
=
null
)
:
Zend_Mail
Sets From-header and sender of the message
setFromToDefaultFrom(
)
:
Zend_Mail
Sets From-name and -email based on the defaults
setHeaderEncoding(
string $encoding
)
:
Zend_Mail
Set the encoding of mail headers
setMessageId(
boolean|string $id
=
true
)
:
Zend_Mail
Sets the Message-ID of the message
setMimeBoundary(
string $boundary
)
:
Zend_Mail
Set an arbitrary mime boundary for the message
If not set, Zend_Mime will generate one.
setReplyTo(
string $email, string $name
=
null
)
:
Zend_Mail
Set Reply-To Header
setReplyToFromDefault(
)
:
Zend_Mail
Sets ReplyTo-name and -email based on the defaults
setReturnPath(
string $email
)
:
Zend_Mail
Sets the Return-Path header of the message
setSubject(
string $subject
)
:
Zend_Mail
Sets the subject of the message