eZPublish  3.8
eZMail Class Reference

Mail handler. More...

Public Member Functions

 addBcc ($email, $name=false)
 
 addCc ($email, $name=false)
 
 addExtraHeader ($headerName, $headerValue)
 
 addReceiver ($email, $name=false)
 
 allowedCharsets ()
 
 bccElements ()
 
 bccReceiverTextList ($convert=true)
 
 body ($convert=true)
 
 ccElements ()
 
 ccReceiverTextList ($convert=true)
 
 contentCharset ()
 
 contentDisposition ()
 
 contentTransferEncoding ()
 
 contentType ()
 
 convertHeaderText ($text)
 
 convertText ($text, $isHeader=false)
 
 encodeMimeHeader ($str)
 
 extractEmail ($text, &$email, &$name)
 
 extraHeaders ()
 
 eZMail ()
 
 headers ($parameters=array())
 
 headerText ($parameters=array())
 
 headerTextList ($parameters=array())
 
 isAllowedCharset ($charset)
 
 messageID ()
 
 mimeVersion ()
 
 outputCharset ()
 
 receiverElements ()
 
 receiverEmailText ($convert=true)
 
 receiverText ($convert=true)
 
 receiverTextList ($convert=true)
 
 references ()
 
 replyTo ($convert=true)
 
 sender ($convert=true)
 
 senderText ($convert=true)
 
 setBccElements ($newBcc)
 
 setBody ($newBody)
 
 setCcElements ($newCc)
 
 setContentType ($type=false, $charset=false, $transferEncoding=false, $disposition=false, $boundary=false)
 
 setExtraHeader ($headerName, $headerValue)
 
 setExtraHeaders ($headers)
 
 setMessageID ($newMessageID)
 
 setMIMEVersion ($version)
 
 setReceiver ($email, $name=false)
 
 setReceiverElements ($toElements)
 
 setReceiverText ($text)
 
 setReferences ($newReference)
 
 setReplyTo ($email, $name=false)
 
 setSender ($email, $name=false)
 
 setSenderText ($text)
 
 setSubject ($newSubject)
 
 setUserAgent ($agent)
 
 subject ($convert=true)
 
 usedCharset ()
 
 userAgent ($convert=true)
 

Static Public Member Functions

 blankNewlines ($text)
 
 composeEmailItems ($items, $join=true, $key=false, $convert=true)
 
 composeEmailName ($item, $key=false, $convert=true)
 
 contentString ($content)
 
splitList ($emails)
 
 stripEmail ($address)
 
 validate ($address)
 

Private Attributes

 $BccElements
 
 $BodyText
 
 $CcElements
 
 $ContentType
 
 $ExtraHeaders
 
 $From
 
 $MessageID
 
 $ReceiverElements
 
 $ReplyTo
 
 $Subject
 
 $TextCodec
 
 $UserAgent
 

Detailed Description

Mail handler.

Class for storing the details about en email and providing text serialization.

Note
It's important to note that most methods that return values do an automatic conversion if not specified.

Member Function Documentation

eZMail::addBcc (   $email,
  $name = false 
)

Adds a new Bcc address.

eZMail::addCc (   $email,
  $name = false 
)

Adds a new Cc address.

eZMail::addExtraHeader (   $headerName,
  $headerValue 
)

Adds the headers $headerName with header value $headerValue to the extra headers.

Referenced by setExtraHeader().

eZMail::addReceiver (   $email,
  $name = false 
)

Adds a new receiver address.

eZMail::allowedCharsets ( )
Returns
an array with charsets that can be used directly as output charsets.

Referenced by isAllowedCharset().

eZMail::bccElements ( )

Returns the addresses which should get a blind carbon copy.

eZMail::bccReceiverTextList (   $convert = true)
eZMail::blankNewlines (   $text)
static
Returns
a text which does not contain newlines, newlines are converted to spaces.

Referenced by headerText(), and headerTextList().

eZMail::body (   $convert = true)

returns the body.

eZMail::ccElements ( )

Returns the addresses which should get a carbon copy.

eZMail::ccReceiverTextList (   $convert = true)

Returns the receiver cc addresses as an array with texts.

eZMail::composeEmailItems (   $items,
  $join = true,
  $key = false,
  $convert = true 
)
static

Composes an email text out of all items in $items and returns it. All items are comma separated.

Referenced by bccReceiverTextList(), ccReceiverTextList(), headers(), receiverEmailText(), receiverText(), and receiverTextList().

eZMail::composeEmailName (   $item,
  $key = false,
  $convert = true 
)
static

Composes a text out of the email and name and returns it.

Example: John Doe john@.nosp@m.doe..nosp@m.com or just john@.nosp@m.doe..nosp@m.com

Referenced by composeEmailItems(), headers(), and senderText().

eZMail::contentCharset ( )
Returns
the charset for this email, this is normally taken from the internal charset.
See Also
usedCharset

Referenced by convertHeaderText(), convertText(), encodeMimeHeader(), and usedCharset().

eZMail::contentDisposition ( )
Returns
the content disposition, normally this is inline.
eZMail::contentString (   $content)
static
Returns
the header content as a simple string, will deflate arrays.
See Also
blankNewLines

Referenced by headerText(), and headerTextList().

eZMail::contentTransferEncoding ( )
Returns
the content transfer encoding, normally this is 8bit.
eZMail::contentType ( )
Returns
the content type for this email, this is normally text/plain.
eZMail::convertHeaderText (   $text)

Calls convertText with $isHeader set to true.

Referenced by composeEmailName(), replyTo(), sender(), senderText(), subject(), and userAgent().

eZMail::convertText (   $text,
  $isHeader = false 
)

Converts the text $text to a suitable output format.

Note
Header conversion is not supported yet, for now it will only return original text when $isHeader is set to true.

Referenced by body().

eZMail::encodeMimeHeader (   $str)

Encodes $str using mb_encode_mimeheader() if it is aviable, or does base64 encodin of a header if not.

Referenced by convertHeaderText().

eZMail::extractEmail (   $text,
$email,
$name 
)
eZMail::extraHeaders ( )

Return the extra headers

eZMail::eZMail ( )

Constructs a new eZMail object.

eZMail::headers (   $parameters = array())
Returns
an array with headers, each header item is an associative array with the keys name and content. content will either be a string or an array with strings.

The parameter $parameters contains optional parameters, they can be:

  • exclude-headers - Array of header names which will not be included in the result array.
    See Also
    contentString, blankNewLines

Referenced by headerText(), and headerTextList().

eZMail::headerText (   $parameters = array())

Composes a text field out of all the headers and returns it. The parameter $parameters will be passed to the headers() function.

eZMail::headerTextList (   $parameters = array())

Extracts all headers and generates a text string out of it. The parameter $parameters will be passed to the headers() function.

eZMail::isAllowedCharset (   $charset)
Returns
true if the charset $charset is allowed as output charset.
See Also
allowedCharsets.

Referenced by convertText(), and usedCharset().

eZMail::messageID ( )

Returns the message ID format : <number> Read in the RFC's if you want to know more about it..

eZMail::mimeVersion ( )
Returns
the MIME version for this email, normally this is 1.0.
Note
The value is returned as a string.
eZMail::outputCharset ( )
Returns
the default output charset.

Referenced by convertText(), encodeMimeHeader(), and usedCharset().

eZMail::receiverElements ( )

Returns the receiver addresses.

eZMail::receiverEmailText (   $convert = true)

Returns the receiver addresses as text with only the email address.

eZMail::receiverText (   $convert = true)

Returns the receiver addresses as text.

eZMail::receiverTextList (   $convert = true)

Returns the receiver addresses as an array with texts.

eZMail::references ( )

Returns the messageID that this message is a reply to.

eZMail::replyTo (   $convert = true)

Returns the receiver address.

eZMail::sender (   $convert = true)

Returns the sender address.

eZMail::senderText (   $convert = true)

Returns the sender address as text.

eZMail::setBccElements (   $newBcc)

Sets the bcc addresses.

eZMail::setBody (   $newBody)

Sets the body.

eZMail::setCcElements (   $newCc)

Sets the cc addresses.

eZMail::setContentType (   $type = false,
  $charset = false,
  $transferEncoding = false,
  $disposition = false,
  $boundary = false 
)

Sets the various content variables, any parameter which is set to something other than false will overwrite the old value.

Referenced by eZMail().

eZMail::setExtraHeader (   $headerName,
  $headerValue 
)

Similar to addExtraHeader() but will overwrite existing entries.

eZMail::setExtraHeaders (   $headers)

Sets the extra headers to $headers.

eZMail::setMessageID (   $newMessageID)

Sets the message ID. This is a server setting only so BE CAREFUL WITH THIS.

eZMail::setMIMEVersion (   $version)

Sets the MIME version to $version.

eZMail::setReceiver (   $email,
  $name = false 
)

Sets the receiver address.

Note
This will remove all other receivers
See Also
addReceiver, setReceiverElements
eZMail::setReceiverElements (   $toElements)

Sets the receiver addresses.

eZMail::setReceiverText (   $text)

Sets the receiver address, the email and name will be extracted from $text.

Note
This will remove all other receivers
See Also
addReceiver, setReceiverElements
eZMail::setReferences (   $newReference)

Sets the messageID that this message is a reply to.

eZMail::setReplyTo (   $email,
  $name = false 
)

Sets the receiver address.

eZMail::setSender (   $email,
  $name = false 
)

Sets the sender address.

eZMail::setSenderText (   $text)

Sets the sender address, the email and name will be extracted from $text.

eZMail::setSubject (   $newSubject)

Sets the subject of the mail.

eZMail::setUserAgent (   $agent)

Sets the user agent for the email to $agent.

& eZMail::splitList (   $emails)
static

Splits a list of email addresses into an array where each entry is an email address.

eZMail::stripEmail (   $address)
static

Static function for extracting an e-mail from text

Returns the first valid e-mail in address, returns false if no e-mail addresses found

eZMail::subject (   $convert = true)

Returns the subject.

Referenced by headers().

eZMail::usedCharset ( )
Returns
the charset which will be used for output.

Referenced by headers().

eZMail::userAgent (   $convert = true)
Returns
the user agent for this email, the user agent is automatically created if not specfied.

Member Data Documentation

eZMail::$BccElements
private

Referenced by bccElements().

eZMail::$BodyText
private

Referenced by body().

eZMail::$CcElements
private

Referenced by ccElements().

eZMail::$ContentType
private
eZMail::$ExtraHeaders
private

Referenced by extraHeaders(), and headers().

eZMail::$From
private

Referenced by sender().

eZMail::$MessageID
private

Referenced by messageID().

eZMail::$ReceiverElements
private

Referenced by receiverElements().

eZMail::$ReplyTo
private

Referenced by replyTo().

eZMail::$Subject
private

Referenced by subject().

eZMail::$TextCodec
private
eZMail::$UserAgent
private

Referenced by userAgent().


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