|
eZ Publish
[trunk]
|
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) | |
| composeEmailItems ($items, $join=true, $key=false, $convert=true) | |
| composeEmailName ($item, $key=false, $convert=true) | |
| contentCharset () | |
| contentDisposition () | |
| contentTransferEncoding () | |
| contentType () | |
| convertHeaderText ($text) | |
| convertText ($text, $isHeader=false) | |
| encodeMimeHeader ($str) | |
| 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 | |
| static | blankNewlines ($text) |
| static | contentString ($content) |
| static | extractEmail ($text, &$email, &$name) |
| static | lineSeparator () |
| static & | splitList ($emails) |
| static | stripEmail ($address) |
| static | validate ($address) |
Public Attributes | |
| $BccElements | |
| $BodyText | |
| $CcElements | |
| $ContentType | |
| $ExtraHeaders | |
| $From | |
| $MessageID | |
| $MIMEVersion | |
| $ReceiverElements | |
| $ReplyTo | |
| $Subject | |
| $TextCodec | |
| $UserAgent | |
| const | REGEXP = '(((\"[^\"\f\n\r\t\v\b]+\")|([A-Za-z0-9_\!\#\$\%\&\'\*\+\-\~\/\^\`\|\{\}]+(\.[A-Za-z0-9_\!\#\$\%\&\'\*\+\-\~\/\^\`\|\{\}]+)*))@((\[(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))\])|(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))|((([A-Za-z0-9\-])+\.)+[A-Za-z\-]{2,})))' |
Mail handler.
Class for storing the details about en email and providing text serialization.
This class will be deprecated in the next eZ Publish release, and replaced with ezcMail from eZ Components.
The eZMail class was used like this (with old smtp class which will be removed): $mail = new eZMail(); $mail->setSender( $fromEmail, $yourName ); $mail->setReceiver( $receiversEmail, $receiversName ); $mail->setSubject( $subject );
$smtp = new smtp( $parameters ); $smtpConnected = $smtp->connect(); if ( $smtpConnected ) { $result = $smtp->send( $sendData ); }
Since the smtp class will be removed, ezcMailSmtpTransport from eZ Components can be used temporarily instead (the class eZSMTPTransport is using ezcMailSmtpTransport instead of smtp as well):
$smtp = new ezcMailSmtpTransport( $host, $username, $password, $port ); $smtp->send( $mail->Mail );
Instead of the code above, ezcMail will be used together with the SMTP transport from eZ Components (MTA transport will work as well):
$mail = new ezpMail(); $mail->from = new ezcMailAddress( $fromEmail, $yourName, $charset ); $mail->addTo( new ezcMailAddress( $receiversEmail, $receiversName, $charset ) ); $mail->subject = $subject;
$smtp = new ezcMailSmtpTransport( $host, $username, $password, $port ); $smtp->send( $mail );
Definition at line 59 of file ezmail.php.
| eZMail::addBcc | ( | $ | email, |
| $ | name = false |
||
| ) |
| eZMail::addCc | ( | $ | email, |
| $ | name = false |
||
| ) |
| eZMail::addExtraHeader | ( | $ | headerName, |
| $ | headerValue | ||
| ) |
Adds the headers $headerName with header value $headerValue to the extra headers.
Definition at line 580 of file ezmail.php.
Referenced by setExtraHeader().
| eZMail::addReceiver | ( | $ | email, |
| $ | name = false |
||
| ) |
Definition at line 1139 of file ezmail.php.
Referenced by isAllowedCharset().
Returns the addresses which should get a blind carbon copy.
Definition at line 220 of file ezmail.php.
| eZMail::bccReceiverTextList | ( | $ | convert = true | ) |
Definition at line 148 of file ezmail.php.
| static eZMail::blankNewlines | ( | $ | text | ) | [static] |
Definition at line 797 of file ezmail.php.
Referenced by headerText(), and headerTextList().
| eZMail::body | ( | $ | convert = true | ) |
Returns the body.
Definition at line 693 of file ezmail.php.
Referenced by eZFileTransport\sendMail(), and eZSendmailTransport\sendMail().
Returns the addresses which should get a carbon copy.
Definition at line 202 of file ezmail.php.
| eZMail::ccReceiverTextList | ( | $ | convert = true | ) |
Returns the receiver cc addresses as an array with texts.
Definition at line 132 of file ezmail.php.
| eZMail::composeEmailItems | ( | $ | items, |
| $ | join = true, |
||
| $ | key = false, |
||
| $ | convert = true |
||
| ) |
Composes an email text out of all items in $items and returns it. All items are comma separated.
Definition at line 846 of file ezmail.php.
Referenced by bccReceiverTextList(), ccReceiverTextList(), headers(), receiverEmailText(), receiverText(), and receiverTextList().
| eZMail::composeEmailName | ( | $ | item, |
| $ | key = false, |
||
| $ | convert = true |
||
| ) |
Composes a text out of the email and name and returns it.
Example: John Doe <john@doe.com> or just john@doe.com
Definition at line 824 of file ezmail.php.
Referenced by composeEmailItems(), headers(), and senderText().
Definition at line 318 of file ezmail.php.
Referenced by convertHeaderText(), convertText(), encodeMimeHeader(), and usedCharset().
Definition at line 339 of file ezmail.php.
| static eZMail::contentString | ( | $ | content | ) | [static] |
Definition at line 809 of file ezmail.php.
Referenced by headerText(), and headerTextList().
Definition at line 328 of file ezmail.php.
Definition at line 306 of file ezmail.php.
| eZMail::convertHeaderText | ( | $ | text | ) |
Calls convertText with $isHeader set to true.
Definition at line 1046 of file ezmail.php.
Referenced by composeEmailName(), replyTo(), sender(), senderText(), subject(), and userAgent().
| eZMail::convertText | ( | $ | text, |
| $ | isHeader = false |
||
| ) |
Converts the text $text to a suitable output format.
true.Definition at line 1100 of file ezmail.php.
Referenced by body().
| eZMail::encodeMimeHeader | ( | $ | str | ) |
Encodes $str using mb_encode_mimeheader() if it is available, or does base64 encoding of a header if not.
Definition at line 1062 of file ezmail.php.
Referenced by convertHeaderText().
| static eZMail::extractEmail | ( | $ | text, |
| &$ | email, | ||
| &$ | name | ||
| ) | [static] |
Extracts email addresses from $text.
Definition at line 759 of file ezmail.php.
Referenced by eZSMTPTransport\sendMail(), setReceiverText(), and setSenderText().
| eZMail::eZMail | ( | ) |
Constructs a new eZMail object.
Definition at line 66 of file ezmail.php.
| eZMail::headers | ( | $ | parameters = array() | ) |
name and content. content will either be a string or an array with strings.The parameter $parameters contains optional parameters, they can be:
Array of header names which will not be included in the result array. Definition at line 872 of file ezmail.php.
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.
Definition at line 1022 of file ezmail.php.
Referenced by eZFileTransport\sendMail(), and eZSendmailTransport\sendMail().
| 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.
Definition at line 999 of file ezmail.php.
| eZMail::isAllowedCharset | ( | $ | charset | ) |
true if the charset $charset is allowed as output charset. Definition at line 1121 of file ezmail.php.
Referenced by convertText(), and usedCharset().
| static eZMail::lineSeparator | ( | ) | [static] |
Returns the line ending.
Definition at line 1176 of file ezmail.php.
Referenced by encodeMimeHeader(), headerText(), and setBody().
Returns the message ID format : <number@serverID> Read in the RFC's if you want to know more about it..
Definition at line 626 of file ezmail.php.
Definition at line 295 of file ezmail.php.
Definition at line 1164 of file ezmail.php.
Referenced by convertText(), encodeMimeHeader(), and usedCharset().
| eZMail::receiverEmailText | ( | $ | convert = true | ) |
Returns the receiver addresses as text with only the email address.
Definition at line 103 of file ezmail.php.
Referenced by eZSendmailTransport\sendMail().
| eZMail::receiverText | ( | $ | convert = true | ) |
| eZMail::receiverTextList | ( | $ | convert = true | ) |
Returns the receiver addresses as an array with texts.
Definition at line 166 of file ezmail.php.
Returns the messageID that this message is a reply to.
Definition at line 648 of file ezmail.php.
| eZMail::replyTo | ( | $ | convert = true | ) |
| eZMail::sender | ( | $ | convert = true | ) |
Returns the sender address.
Definition at line 252 of file ezmail.php.
Referenced by eZFileTransport\sendMail(), and eZSendmailTransport\sendMail().
| eZMail::senderText | ( | $ | convert = true | ) |
Returns the sender address as text.
Definition at line 280 of file ezmail.php.
Referenced by eZSMTPTransport\sendMail().
| eZMail::setBccElements | ( | $ | newBcc | ) |
| eZMail::setBody | ( | $ | newBody | ) |
| eZMail::setCcElements | ( | $ | newCc | ) |
| 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.
Definition at line 376 of file ezmail.php.
Referenced by eZMail().
| eZMail::setExtraHeader | ( | $ | headerName, |
| $ | headerValue | ||
| ) |
Similar to addExtraHeader() but will overwrite existing entries.
Definition at line 592 of file ezmail.php.
| eZMail::setExtraHeaders | ( | $ | headers | ) |
| eZMail::setMessageID | ( | $ | newMessageID | ) |
Sets the message ID. This is a server setting only so BE CAREFUL WITH THIS.
Definition at line 637 of file ezmail.php.
| eZMail::setMIMEVersion | ( | $ | version | ) |
| eZMail::setReceiver | ( | $ | email, |
| $ | name = false |
||
| ) |
Sets the receiver address.
Definition at line 438 of file ezmail.php.
| eZMail::setReceiverElements | ( | $ | toElements | ) |
| eZMail::setReceiverText | ( | $ | text | ) |
Sets the receiver address, the email and name will be extracted from $text.
Definition at line 452 of file ezmail.php.
| eZMail::setReferences | ( | $ | newReference | ) |
Sets the messageID that this message is a reply to.
Definition at line 658 of file ezmail.php.
| eZMail::setReplyTo | ( | $ | email, |
| $ | name = false |
||
| ) |
| eZMail::setSender | ( | $ | email, |
| $ | name = false |
||
| ) |
| eZMail::setSenderText | ( | $ | text | ) |
Sets the sender address, the email and name will be extracted from $text.
Definition at line 501 of file ezmail.php.
Referenced by eZFileTransport\sendMail(), eZSMTPTransport\sendMail(), and eZSendmailTransport\sendMail().
| eZMail::setSubject | ( | $ | newSubject | ) |
| eZMail::setUserAgent | ( | $ | agent | ) |
| static& eZMail::splitList | ( | $ | emails | ) | [static] |
Splits a list of email addresses into an array where each entry is an email address.
Definition at line 735 of file ezmail.php.
| static 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
Definition at line 781 of file ezmail.php.
| eZMail::subject | ( | $ | convert = true | ) |
Returns the subject.
Definition at line 668 of file ezmail.php.
Referenced by headers(), and eZSendmailTransport\sendMail().
Definition at line 1151 of file ezmail.php.
Referenced by addBcc(), addCc(), addReceiver(), eZMail(), headers(), setBccElements(), setBody(), setCcElements(), setReceiver(), setReceiverElements(), setReceiverText(), setReplyTo(), setSender(), setSenderText(), and setSubject().
| eZMail::userAgent | ( | $ | convert = true | ) |
Definition at line 351 of file ezmail.php.
| static eZMail::validate | ( | $ | address | ) | [static] |
Static function for validating e-mail addresses.
Returns true if successful, false if not.
Definition at line 749 of file ezmail.php.
Referenced by eZUser\_loginUser(), eZStepSiteAdmin\processPostData(), eZStepRegistration\processPostData(), eZSimplifiedXMLInputParser\publishHandlerLink(), eZSMTPTransport\sendMail(), eZFileTransport\sendMail(), eZSendmailTransport\sendMail(), and eZEmailType\validateEMailHTTPInput().
| eZMail::$BccElements |
Definition at line 1210 of file ezmail.php.
| eZMail::$BodyText |
Definition at line 1215 of file ezmail.php.
| eZMail::$CcElements |
Definition at line 1209 of file ezmail.php.
| eZMail::$ContentType |
Definition at line 1211 of file ezmail.php.
| eZMail::$ExtraHeaders |
Definition at line 1216 of file ezmail.php.
| eZMail::$From |
Definition at line 1208 of file ezmail.php.
| eZMail::$Mail |
Definition at line 1229 of file ezmail.php.
| eZMail::$MessageID |
Definition at line 1218 of file ezmail.php.
| eZMail::$MIMEVersion |
Definition at line 1219 of file ezmail.php.
| eZMail::$ReceiverElements |
Definition at line 1207 of file ezmail.php.
| eZMail::$ReplyTo |
Definition at line 1213 of file ezmail.php.
| eZMail::$Subject |
Definition at line 1214 of file ezmail.php.
| eZMail::$TextCodec |
Definition at line 1217 of file ezmail.php.
| eZMail::$UserAgent |
Definition at line 1212 of file ezmail.php.
| const eZMail::REGEXP = '(((\"[^\"\f\n\r\t\v\b]+\")|([A-Za-z0-9_\!\#\$\%\&\'\*\+\-\~\/\^\`\|\{\}]+(\.[A-Za-z0-9_\!\#\$\%\&\'\*\+\-\~\/\^\`\|\{\}]+)*))@((\[(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))\])|(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))|((([A-Za-z0-9\-])+\.)+[A-Za-z\-]{2,})))' |
Definition at line 61 of file ezmail.php.
Referenced by extractEmail(), stripEmail(), and validate().