EmailComponent Class Info:
- Class Declaration:
- class EmailComponent extends Object
- File name:
- cake/libs/controller/components/email.php
- Summary:
- EmailComponent This component is used for handling Internet Message Format based based on the standard outlined in http://www.rfc-editor.org/rfc/rfc2822.txt
- Class Inheritance
- package
- cake
- subpackage
- cake.cake.libs.controller.components
Properties:
Show/Hide parent properties
| public | additionalParams | List of additional headers These will NOT be used if you are using safemode and mail() |
| public | attachments | List of files that should be attached to the email. Can be both absolute and relative paths |
| public | bcc | Blind Carbon Copy List of email's that should receive a copy of the email. The Recipient WILL NOT be able to see this list |
| public | cc | Carbon Copy List of email's that should receive a copy of the email. The Recipient WILL be able to see this list |
| public | charset | charset the email is sent in |
| protected | _debug | If set to true, the mail method will be auto-set to 'debug' |
| public | delivery | What method should the email be sent by Supported methods: - mail - smtp - debug |
| public | filePaths | The list of paths to search if an attachment isnt absolute |
| public | from | The mail which the email is sent from |
| public | headers | Associative array of a user defined headers Keys will be prefixed 'X-' as per RFC2822 Section 4.7.5 |
| public | layout | Layout for the View |
| public | _lineLength | |
| public | lineLength | as per RFC2822 Section 2.1.1 |
| protected | _log | Log object |
| public | readReceipt | The read receipt email |
| public | replyTo | The email the recipient will reply to |
| public | return | The mail that will be used in case of any errors like - Remote mailserver down - Remote user has exceeded his quota - Unknown user |
| public | sendAs | What format should the email be sent in Supported formats: - text - html - both |
| public | smtpError | Placeholder for any errors that might happen with the smtp mail methods |
| public | smtpOptions | List of options to use for smtp mail method Options is: - port - host - timeout - username - password - client |
| public | subject | The subject of the email |
| public | template | Template for the view |
| public | to | Recipient of the email |
| public | xMailer | What mailer should EmailComponent identify itself as |
Method Summary:
Show/Hide parent methods
| public | cakeError( $method, $messages = array ( ) ) |
| public | __construct( ) |
| public | dispatchMethod( $method, $params = array ( ) ) |
| public | initialize( $controller, $settings = array ( ) ) |
| public | log( $msg, $type = 2 ) |
| public | Object( ) |
| protected | _persist( $name, $return, $object, $type = NULL ) |
| public | requestAction( $url, $extra = array ( ) ) |
| public | reset( ) |
| protected | _savePersistent( $name, $object ) |
| public | send( $content = NULL, $template = NULL, $layout = NULL ) |
| protected | _set( $properties = array ( ) ) |
| public | startup( $controller ) |
| public | _stop( $status = 0 ) |
| public | toString( ) |
cakeError
topUsed to report user friendly errors.
If there is a file app/error.php or app/app_error.php this file will be loaded
error.php is the AppError class it should extend ErrorHandler class.
- Parameters:
-
$method string Method to be called in the error class (AppError or ErrorHandler classes) required (no default) $messages array Message that is to be displayed by the error class optional array ( ) - Method defined in class:
- Object
- Method defined in file:
- cake/libs/object.php on line 189
- return
- error message
- access
- public
__construct
topClass constructor, overridden in descendant classes.
- Method defined in class:
- Object
- Method defined in file:
- cake/libs/object.php on line 63
dispatchMethod
topCalls a method on this object with the given parameters. Provides an OO wrapper
for call_user_func_array, and improves performance by using straight method calls
in most cases.
- Parameters:
-
$method string Name of the method to call required (no default) $params array Parameter list to use when calling $method optional array ( ) - Method defined in class:
- Object
- Method defined in file:
- cake/libs/object.php on line 113
- return
- mixed Returns the result of the method call
- access
- public
initialize
topInitialize component
- Parameters:
-
$controller object Instantiating controller required (no default) $settings optional array ( ) - Method defined in class:
- EmailComponent
- Method defined in file:
- cake/libs/controller/components/email.php on line 266
- access
- public
log
topAPI for logging events.
- Parameters:
-
$msg string Log message required (no default) $type integer Error type constant. Defined in app/config/core.php. optional 2 - Method defined in class:
- Object
- Method defined in file:
- cake/libs/object.php on line 150
- return
- boolean Success of log write
- access
- public
Object
topA hack to support __construct() on PHP 4
Hint: descendant classes have no PHP4 class_name() constructors,
so this constructor gets called first and calls the top-layer __construct()
which (if present) should call parent::__construct()
- Method defined in class:
- Object
- Method defined in file:
- cake/libs/object.php on line 53
- return
- Object
_persist
topChecks for a persistent class file, if found file is opened and true returned
If file is not found a file is created and false returned
If used in other locations of the model you should choose a unique name for the persistent file
There are many uses for this method, see manual for examples
- Parameters:
-
$name string name of the class to persist required (no default) $return required (no default) $object string the object to persist required (no default) $type optional NULL - Method defined in class:
- Object
- Method defined in file:
- cake/libs/object.php on line 219
- return
- boolean Success
- access
- protected
- todo
- add examples to manual
requestAction
topCalls a controller's method from any location.
- Parameters:
-
$url mixed String or array-based url. required (no default) $extra array if array includes the key "return" it sets the AutoRender to true. optional array ( ) - Method defined in class:
- Object
- Method defined in file:
- cake/libs/object.php on line 86
- return
- mixed Boolean true or false on success/failure, or contents of rendered action if 'return' is set in $extra.
- access
- public
reset
topReset all EmailComponent internal variables to be able to send out a new email.
- Method defined in class:
- EmailComponent
- Method defined in file:
- cake/libs/controller/components/email.php on line 339
- access
- public
_savePersistent
topYou should choose a unique name for the persistent file
There are many uses for this method, see manual for examples
- Parameters:
-
$name string name used for object to cache required (no default) $object object the object to persist required (no default) - Method defined in class:
- Object
- Method defined in file:
- cake/libs/object.php on line 247
- return
- boolean true on save, throws error if file can not be created
- access
- protected
send
topSend an email using the specified content, template and layout
- Parameters:
-
$content mixed Either an array of text lines, or a string with contents optional NULL $template string Template to use when sending email optional NULL $layout string Layout to use to enclose email body optional NULL - Method defined in class:
- EmailComponent
- Method defined in file:
- cake/libs/controller/components/email.php on line 289
- return
- boolean Success
- access
- public
_set
topAllows setting of multiple properties of the object in a single line of code.
- Parameters:
-
$properties array An associative array containing properties and corresponding values. optional array ( ) - Method defined in class:
- Object
- Method defined in file:
- cake/libs/object.php on line 169
- return
- void
- access
- protected
startup
topStartup component
- Parameters:
-
$controller object Instantiating controller required (no default) - Method defined in class:
- EmailComponent
- Method defined in file:
- cake/libs/controller/components/email.php on line 279
- access
- public
_stop
topStop execution of the current script
- Parameters:
-
$status optional 0 - Method defined in class:
- Object
- Method defined in file:
- cake/libs/object.php on line 139
- return
- void
- access
- public
toString
topObject-to-string conversion.
Each class can override this method as necessary.
- Method defined in class:
- Object
- Method defined in file:
- cake/libs/object.php on line 73
- return
- string The name of this class
- access
- public