Class SmtpTransport
Send mail using SMTP protocol
- AbstractTransport
- SmtpTransport
Copyright: Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
License: MIT License
Located at Cake/Network/Email/SmtpTransport.php
Method Detail
_bufferResponseLinessource protected
_bufferResponseLines( array $responseLines )
Parses and stores the reponse lines in 'code' => 'message'
format.
Parameters
- array
$responseLines
- Response lines to parse.
_generateSocketsource protected
_generateSocket( )
Helper method to generate socket
Throws
SocketException
SocketException
_prepareFromAddresssource protected
_prepareFromAddress( )
Prepares the from
email address.
Returns
array
array
_prepareFromCmdsource protected
_prepareFromCmd( string $email )
Prepares the MAIL FROM
SMTP command.
Parameters
- string
$email
- The email address to send with the command.
Returns
string
string
_prepareMessageHeaderssource protected
_prepareMessageHeaders( )
Prepares the message headers.
Returns
array
array
_prepareRcptCmdsource protected
_prepareRcptCmd( string $email )
Prepares the RCPT TO
SMTP command.
Parameters
- string
$email
- The email address to send with the command.
Returns
string
string
_prepareRecipientAddressessource protected
_prepareRecipientAddresses( )
Prepares the recipient email addresses.
Returns
array
array
_smtpSendsource protected
_smtpSend( string|null $data , string|boolean $checkCode '250' )
Protected method for sending data to SMTP connection
Parameters
- string|null
$data
- Data to be sent to SMTP server
- string|boolean
$checkCode
optional '250' - Code to check for in server response, false to skip
Returns
string|null
The matched code, or null if nothing matched
Throws
SocketException
SocketException
configsource public
config( array $config null )
Set the configuration
Parameters
- array
$config
optional null - Configuration options.
Returns
array
Returns configs
Overrides
AbstractTransport::config()
getLastResponsesource public
getLastResponse( )
Returns the response of the last sent SMTP command.
A response consists of one or more lines containing a response code and an optional response message text:
array( array( 'code' => '250', 'message' => 'mail.example.com' ), array( 'code' => '250', 'message' => 'PIPELINING' ), array( 'code' => '250', 'message' => '8BITMIME' ), // etc... )
Returns
array
array
sendsource public
send( CakeEmail $email )
Send mail
Parameters
-
CakeEmail
$email
- CakeEmail
Returns
array
array
Throws
SocketException
SocketException
Methods inherited from AbstractTransport
_headersToStringsource protected
_headersToString( array $headers , string $eol "\r\n" )
Help to convert headers in string
Parameters
- array
$headers
- Headers in format key => value
- string
$eol
optional "\r\n" - End of line string.
Returns
string
string
Properties summary
Properties inherited from AbstractTransport
© 2005–2016 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
http://api.cakephp.org/2.7/class-SmtpTransport.html