EmailComponent Class Reference

Inheritance diagram for EmailComponent:

Object List of all members.

Public Member Functions

 __attachFiles ()
 __createBoundary ()
 __createHeader ()
 __debug ()
 __encode ($subject)
 __findFiles ($attachment)
 __formatAddress ($string, $smtp=false)
 __formatMessage ($message)
 __mail ()
 __renderTemplate ($content)
 __smtp ()
 __smtpSend ($data, $checkCode= '250')
 __strip ($value, $message=false)
 __wrap ($message)
 initialize (&$controller, $settings=array())
 reset ()
 send ($content=null, $template=null, $layout=null)
 startup (&$controller)

Public Attributes

 $__boundary = null
 $__header = array()
 $__message = array()
 $__smtpConnection = null
 $_debug = false
 $_lineLength = null
 $additionalParams = null
 $attachments = array()
 $bcc = array()
 $cc = array()
 $charset = 'utf-8'
 $delivery = 'mail'
 $filePaths = array()
 $from = null
 $headers = array()
 $layout = 'default'
 $lineLength = 70
 $readReceipt = null
 $replyTo = null
 $return = null
 $sendAs = 'text'
 $smtpError = null
 $smtpOptions
 $subject = null
 $template = null
 $to = null
 $xMailer = 'CakePHP Email Component'

Detailed Description

Definition at line 38 of file email.php.


Member Function Documentation

EmailComponent::__attachFiles (  ) 

Attach files by adding file contents inside boundaries.

private : modify to use the core File class?

Definition at line 526 of file email.php.

References $handle, and __findFiles().

Referenced by send().

EmailComponent::__createBoundary (  ) 

Create unique boundary identifier

private

Definition at line 438 of file email.php.

References md5().

Referenced by __createHeader().

EmailComponent::__createHeader (  ) 

Create emails headers including (but not limited to) from email address, reply to, bcc and cc.

private

Definition at line 447 of file email.php.

References __createBoundary(), __encode(), __formatAddress(), a(), and e().

Referenced by send().

EmailComponent::__debug (  ) 

Set as controller flash message a debug message showing current settings in component

Returns:
boolean Success private

Definition at line 769 of file email.php.

References __encode().

Referenced by send().

EmailComponent::__encode ( subject  ) 

Encode the specified string using the current charset

Parameters:
string $subject String to encode
Returns:
string Encoded string private

Definition at line 603 of file email.php.

References $subject, and __strip().

Referenced by __createHeader(), __debug(), __formatAddress(), and __mail().

EmailComponent::__findFiles ( attachment  ) 

Find the specified attachment in the list of file paths

Parameters:
string $attachment Attachment file name to find
Returns:
string Path to located file private

Definition at line 557 of file email.php.

References $path.

Referenced by __attachFiles().

EmailComponent::__formatAddress ( string,
smtp = false 
)

Format a string as an email address

Parameters:
string $string String representing an email address
Returns:
string Email address suitable for email headers or smtp pipe private

Definition at line 619 of file email.php.

References __encode(), and __strip().

Referenced by __createHeader(), and __smtp().

EmailComponent::__formatMessage ( message  ) 

Format the message by seeing if it has attachments.

Parameters:
string $message Message to format private

Definition at line 504 of file email.php.

Referenced by send().

EmailComponent::__mail (  ) 

Wrapper for PHP mail function used for sending out emails

Returns:
bool Success private

Definition at line 657 of file email.php.

References __encode().

EmailComponent::__renderTemplate ( content  ) 

Render the contents using the current layout and template.

Parameters:
string $content Content to render
Returns:
array Email ready to be sent private

Definition at line 361 of file email.php.

References App::import().

Referenced by send().

EmailComponent::__smtp (  ) 

Sends out email via SMTP

Returns:
bool Success private

Definition at line 671 of file email.php.

References $bcc, $cc, __formatAddress(), __smtpSend(), env(), and App::import().

EmailComponent::__smtpSend ( data,
checkCode = '250' 
)

Private method for sending data to SMTP connection

Parameters:
string $data data to be sent to SMTP server
mixed $checkCode code to check for in server response, false to skip
Returns:
bool Success private

Definition at line 748 of file email.php.

Referenced by __smtp().

EmailComponent::__strip ( value,
message = false 
)

Remove certain elements (such as bcc:, to:, 0a) from given value

Parameters:
string $value Value to strip
boolean $message Set to true to indicate main message content
Returns:
string Stripped value private

Definition at line 638 of file email.php.

References a(), and r().

Referenced by __encode(), __formatAddress(), and __wrap().

EmailComponent::__wrap ( message  ) 

Wrap the message using EmailComponent::$lineLength

Parameters:
string $message Message to wrap
Returns:
array Wrapped message private

Definition at line 576 of file email.php.

References __strip().

Referenced by send().

EmailComponent::initialize ( &$  controller,
settings = array() 
)

Initialize component

Parameters:
object $controller Instantiating controller public

Definition at line 265 of file email.php.

References Object::_set(), and Configure::read().

EmailComponent::reset (  ) 

Reset all EmailComponent internal variables to be able to send out a new email.

public

Definition at line 338 of file email.php.

EmailComponent::send ( content = null,
template = null,
layout = null 
)

Send an email using the specified content, template and layout

Parameters:
mixed $content Either an array of text lines, or a string with contents
string $template Template to use when sending email
string $layout Layout to use to enclose email body
Returns:
boolean Success public

Definition at line 288 of file email.php.

References $layout, $template, __(), __attachFiles(), __createHeader(), __debug(), __formatMessage(), __renderTemplate(), and __wrap().

EmailComponent::startup ( &$  controller  ) 

Startup component

Parameters:
object $controller Instantiating controller public

Definition at line 278 of file email.php.


Member Data Documentation

EmailComponent::$__boundary = null

Definition at line 244 of file email.php.

EmailComponent::$__header = array()

Definition at line 237 of file email.php.

EmailComponent::$__message = array()

Definition at line 251 of file email.php.

EmailComponent::$__smtpConnection = null

Definition at line 258 of file email.php.

EmailComponent::$_debug = false

Definition at line 230 of file email.php.

EmailComponent::$_lineLength = null

Deprecated:
see lineLength

Definition at line 145 of file email.php.

EmailComponent::$additionalParams = null

Definition at line 120 of file email.php.

EmailComponent::$attachments = array()

Definition at line 185 of file email.php.

EmailComponent::$bcc = array()

Definition at line 96 of file email.php.

Referenced by __smtp().

EmailComponent::$cc = array()

Definition at line 86 of file email.php.

Referenced by __smtp().

EmailComponent::$charset = 'utf-8'

Definition at line 176 of file email.php.

EmailComponent::$delivery = 'mail'

Definition at line 169 of file email.php.

EmailComponent::$filePaths = array()

Definition at line 199 of file email.php.

EmailComponent::$from = null

Definition at line 52 of file email.php.

EmailComponent::$headers = array()

Definition at line 111 of file email.php.

EmailComponent::$layout = 'default'

Definition at line 127 of file email.php.

Referenced by send().

EmailComponent::$lineLength = 70

Definition at line 141 of file email.php.

EmailComponent::$readReceipt = null

Definition at line 66 of file email.php.

EmailComponent::$replyTo = null

Definition at line 59 of file email.php.

EmailComponent::$return = null

Definition at line 76 of file email.php.

EmailComponent::$sendAs = 'text'

Definition at line 157 of file email.php.

EmailComponent::$smtpError = null

Definition at line 223 of file email.php.

EmailComponent::$smtpOptions

Initial value:

 array(
        'port'=> 25, 'host' => 'localhost', 'timeout' => 30
    )

Definition at line 213 of file email.php.

EmailComponent::$subject = null

Definition at line 103 of file email.php.

Referenced by __encode().

EmailComponent::$template = null

Definition at line 134 of file email.php.

Referenced by send().

EmailComponent::$to = null

Definition at line 45 of file email.php.

EmailComponent::$xMailer = 'CakePHP Email Component'

Definition at line 192 of file email.php.


The documentation for this class was generated from the following file:
Generated on Sun Nov 22 00:30:56 2009 for CakePHP 1.2.x.x (v1.2.4.8284) by doxygen 1.4.7