Public Member Functions | Static Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes | Static Protected Attributes

Zend_Mail Class Reference

Inheritance diagram for Zend_Mail:
Zend_Mime_Message

Public Member Functions

 __construct ($charset= 'iso-8859-1')
 getCharset ()
 setType ($type)
 getType ()
 setMimeBoundary ($boundary)
 getMimeBoundary ()
 getEncodingOfHeaders ()
 getHeaderEncoding ()
 setEncodingOfHeaders ($encoding)
 setHeaderEncoding ($encoding)
 setBodyText ($txt, $charset=null, $encoding=Zend_Mime::ENCODING_QUOTEDPRINTABLE)
 getBodyText ($textOnly=false)
 setBodyHtml ($html, $charset=null, $encoding=Zend_Mime::ENCODING_QUOTEDPRINTABLE)
 getBodyHtml ($htmlOnly=false)
 addAttachment (Zend_Mime_Part $attachment)
 createAttachment ($body, $mimeType=Zend_Mime::TYPE_OCTETSTREAM, $disposition=Zend_Mime::DISPOSITION_ATTACHMENT, $encoding=Zend_Mime::ENCODING_BASE64, $filename=null)
 getPartCount ()
 addTo ($email, $name='')
 addCc ($email, $name='')
 addBcc ($email)
 getRecipients ()
 clearRecipients ()
 setFrom ($email, $name=null)
 setReplyTo ($email, $name=null)
 getFrom ()
 clearFrom ()
 setReturnPath ($email)
 getReturnPath ()
 clearReturnPath ()
 setSubject ($subject)
 getSubject ()
 clearSubject ()
 setDate ($date=null)
 getDate ()
 clearDate ()
 setMessageId ($id=true)
 getMessageId ()
 clearMessageId ()
 createMessageId ()
 addHeader ($name, $value, $append=false)
 getHeaders ()
 send ($transport=null)

Static Public Member Functions

static setDefaultTransport (Zend_Mail_Transport_Abstract $transport)

Data Fields

 $hasAttachments = false

Protected Member Functions

 _encodeHeader ($value)
 _storeHeader ($headerName, $value, $append=false)
 _clearHeader ($headerName)
 _addRecipientAndHeader ($headerName, $email, $name)
 _filterEmail ($email)
 _filterName ($name)
 _filterOther ($data)
 _formatAddress ($email, $name)

Protected Attributes

 $_charset = null
 $_headers = array()
 $_headerEncoding = Zend_Mime::ENCODING_QUOTEDPRINTABLE
 $_from = null
 $_to = array()
 $_recipients = array()
 $_returnPath = null
 $_subject = null
 $_date = null
 $_messageId = null
 $_bodyText = false
 $_bodyHtml = false
 $_mimeBoundary = null
 $_type = null

Static Protected Attributes

static $_defaultTransport = null

Detailed Description

Definition at line 52 of file Mail.php.


Constructor & Destructor Documentation

__construct ( charset = 'iso-8859-1' )

Public constructor

Parameters:
string$charset

Definition at line 175 of file Mail.php.


Member Function Documentation

_addRecipientAndHeader ( headerName,
email,
name 
) [protected]

Helper function for adding a recipient and the corresponding header

Parameters:
string$headerName
string$email
string$name

Definition at line 515 of file Mail.php.

_clearHeader ( headerName ) [protected]

Clear header from the message

Parameters:
string$headerName

Definition at line 501 of file Mail.php.

_encodeHeader ( value ) [protected]

Encode header fields

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

Parameters:
string$value
Returns:
string

Definition at line 459 of file Mail.php.

_filterEmail ( email ) [protected]

Filter of email data

Parameters:
string$email
Returns:
string

Definition at line 984 of file Mail.php.

_filterName ( name ) [protected]

Filter of name data

Parameters:
string$name
Returns:
string

Definition at line 1004 of file Mail.php.

_filterOther ( data ) [protected]

Filter of other data

Parameters:
string$data
Returns:
string

Definition at line 1023 of file Mail.php.

_formatAddress ( email,
name 
) [protected]

Formats e-mail address

Parameters:
string$email
string$name
Returns:
string

Definition at line 1040 of file Mail.php.

_storeHeader ( headerName,
value,
append = false 
) [protected]

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.

Parameters:
string$headerName
string$value
bool$append

Definition at line 482 of file Mail.php.

addAttachment ( Zend_Mime_Part attachment )

Adds an existing attachment to the mail message

Parameters:
Zend_Mime_Part$attachment
Returns:
Zend_Mail Provides fluent interface

Definition at line 400 of file Mail.php.

addBcc ( email )

Adds Bcc recipient

Parameters:
string$email
Returns:
Zend_Mail Provides fluent interface

Definition at line 557 of file Mail.php.

addCc ( email,
name = '' 
)

Adds Cc-header and recipient

Parameters:
string$email
string$name
Returns:
Zend_Mail Provides fluent interface

Definition at line 545 of file Mail.php.

addHeader ( name,
value,
append = false 
)

Add a custom header to the message

Parameters:
string$name
string$value
boolean$append
Returns:
Zend_Mail Provides fluent interface
Exceptions:
Zend_Mail_Exceptionon attempts to create standard headers

See also:
Zend_Mail_Exception

Definition at line 920 of file Mail.php.

addTo ( email,
name = '' 
)

Adds To-header and recipient

Parameters:
string$email
string$name
Returns:
Zend_Mail Provides fluent interface

Definition at line 531 of file Mail.php.

clearDate (  )

Clears the formatted date from the message

Returns:
Zend_Mail Provides fluent interface

Definition at line 811 of file Mail.php.

clearFrom (  )

Clears the sender from the mail

Returns:
Zend_Mail Provides fluent interface

Definition at line 643 of file Mail.php.

clearMessageId (  )

Clears the Message-ID from the message

Returns:
Zend_Mail Provides fluent interface

Definition at line 869 of file Mail.php.

clearRecipients (  )

Clears list of recipient email addresses

Returns:
Zend_Mail Provides fluent interface

Definition at line 578 of file Mail.php.

clearReturnPath (  )

Clears the current Return-Path address from the message

Returns:
Zend_Mail Provides fluent interface

Definition at line 695 of file Mail.php.

clearSubject (  )

Clears the encoded subject from the message

Returns:
Zend_Mail Provides fluent interface

Definition at line 741 of file Mail.php.

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

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.

Parameters:
string$body
string$mimeType
string$disposition
string$encoding
string$filenameOPTIONAL A filename for the attachment
Returns:
Zend_Mime_Part Newly created Zend_Mime_Part object (to allow advanced settings)

Definition at line 422 of file Mail.php.

createMessageId (  )

Creates the Message-ID

Returns:
string

Definition at line 882 of file Mail.php.

getBodyHtml ( htmlOnly = false )

Return Zend_Mime_Part representing body HTML

Parameters:
bool$htmlOnlyWhether to return the body HTML only, or the MIME part; defaults to false, the MIME part
Returns:
false|Zend_Mime_Part|string

Definition at line 384 of file Mail.php.

getBodyText ( textOnly = false )

Return text body Zend_Mime_Part or string

Parameters:
booltextOnly Whether to return just the body text content or the MIME part; defaults to false, the MIME part
Returns:
false|Zend_Mime_Part|string

Definition at line 343 of file Mail.php.

getCharset (  )

Return charset string

Returns:
string

Definition at line 185 of file Mail.php.

getDate (  )

Returns the formatted date of the message

Returns:
string

Definition at line 801 of file Mail.php.

getEncodingOfHeaders (  )

Return encoding of mail headers

Deprecated:
use getHeaderEncoding() instead
Returns:
string

Definition at line 259 of file Mail.php.

getFrom (  )

Returns the sender of the mail

Returns:
string

Definition at line 633 of file Mail.php.

getHeaderEncoding (  )

Return the encoding of mail headers

Either Zend_Mime::ENCODING_QUOTEDPRINTABLE or Zend_Mime::ENCODING_BASE64

Returns:
string

Definition at line 271 of file Mail.php.

getHeaders (  )

Return mail headers

Returns:
void

Definition at line 945 of file Mail.php.

getMessageId (  )

Returns the Message-ID of the message

Returns:
string

Definition at line 858 of file Mail.php.

getMimeBoundary (  )

Return the boundary string used for the message

Returns:
string

Definition at line 248 of file Mail.php.

getPartCount (  )

Return a count of message parts

Returns:
integer

Definition at line 445 of file Mail.php.

getRecipients (  )

Return list of recipient email addresses

Returns:
array (of strings)

Definition at line 568 of file Mail.php.

getReturnPath (  )

Returns the current Return-Path address of the message

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

Returns:
string

Definition at line 681 of file Mail.php.

getSubject (  )

Returns the encoded subject of the message

Returns:
string

Definition at line 731 of file Mail.php.

getType (  )

Get content type of the message

Returns:
string

Definition at line 223 of file Mail.php.

send ( transport = null )

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

Parameters:
Zend_Mail_Transport_Abstract$transport
Returns:
Zend_Mail Provides fluent interface

Definition at line 958 of file Mail.php.

setBodyHtml ( html,
charset = null,
encoding = Zend_Mime::ENCODING_QUOTEDPRINTABLE 
)

Sets the HTML body for the message

Parameters:
string$html
string$charset
string$encoding
Returns:
Zend_Mail Provides fluent interface

Definition at line 361 of file Mail.php.

setBodyText ( txt,
charset = null,
encoding = Zend_Mime::ENCODING_QUOTEDPRINTABLE 
)

Sets the text body for the message.

Parameters:
string$txt
string$charset
string$encoding
Returns:
Zend_Mail Provides fluent interface

Definition at line 320 of file Mail.php.

setDate ( date = null )

Sets Date-header

Parameters:
string$date
Returns:
Zend_Mail Provides fluent interface
Exceptions:
Zend_Mail_Exceptionif called subsequent times

See also:
Zend_Mail_Exception
Zend_Mail_Exception
Zend_Mail_Exception

Definition at line 756 of file Mail.php.

static setDefaultTransport ( Zend_Mail_Transport_Abstract transport ) [static]

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

Todo:

Allow passing a string to indicate the transport to load

Allow passing in optional options for the transport to load

Parameters:
Zend_Mail_Transport_Abstract$transport

Definition at line 165 of file Mail.php.

setEncodingOfHeaders ( encoding )

Set the encoding of mail headers

Deprecated:
Use setHeaderEncoding() instead.
Parameters:
string$encoding
Returns:
Zend_Mail

Definition at line 283 of file Mail.php.

setFrom ( email,
name = null 
)

Sets From-header and sender of the message

Parameters:
string$email
string$name
Returns:
Zend_Mail Provides fluent interface
Exceptions:
Zend_Mail_Exceptionif called subsequent times

See also:
Zend_Mail_Exception

Definition at line 598 of file Mail.php.

setHeaderEncoding ( encoding )

Set the encoding of mail headers

Parameters:
string$encodingZend_Mime::ENCODING_QUOTEDPRINTABLE or Zend_Mime::ENCODING_BASE64
Returns:
Zend_Mail Provides fluent interface

See also:
Zend_Mail_Exception

Definition at line 294 of file Mail.php.

setMessageId ( id = true )

Sets the Message-ID of the message

Parameters:
boolean | string$idtrue :Auto false :No set null :No set string:Sets string
Returns:
Zend_Mail Provides fluent interface
Exceptions:
Zend_Mail_Exception

See also:
Zend_Mail_Exception

Definition at line 830 of file Mail.php.

setMimeBoundary ( boundary )

Set an arbitrary mime boundary for the message

If not set, Zend_Mime will generate one.

Parameters:
string$boundary
Returns:
Zend_Mail Provides fluent interface

Definition at line 236 of file Mail.php.

setReplyTo ( email,
name = null 
)

Set Reply-To Header

Parameters:
string$email
string$name
Returns:
Zend_Mail

Definition at line 622 of file Mail.php.

setReturnPath ( email )

Sets the Return-Path header of the message

Parameters:
string$email
Returns:
Zend_Mail Provides fluent interface
Exceptions:
Zend_Mail_Exceptionif set multiple times

See also:
Zend_Mail_Exception

Definition at line 658 of file Mail.php.

setSubject ( subject )

Sets the subject of the message

Parameters:
string$subject
Returns:
Zend_Mail Provides fluent interface
Exceptions:
Zend_Mail_Exception

See also:
Zend_Mail_Exception

Definition at line 710 of file Mail.php.

setType ( type )

Set content type

Should only be used for manually setting multipart content types.

Parameters:
string$typeContent type
Returns:
Zend_Mail Implements fluent interface
Exceptions:
Zend_Mail_Exceptionfor types not supported by Zend_Mime

See also:
Zend_Mail_Exception

Definition at line 199 of file Mail.php.


The documentation for this class was generated from the following file: