Send mail using SMTP protocol
__destruct( )
Destructor
Tries to disconnect to ensure that the connection is being terminated properly before the socket gets closed.
_auth( )
Send authentication
Cake\Network\Exception\SocketException
_bufferResponseLines( array $responseLines )
Parses and stores the response lines in 'code' => 'message'
format.
$responseLines
_connect( )
Connect to SMTP Server
Cake\Network\Exception\SocketException
_disconnect( )
Disconnect
Cake\Network\Exception\SocketException
_generateSocket( )
Helper method to generate socket
Cake\Network\Exception\SocketException
_prepareFromAddress( Cake\Mailer\Email $email )
Prepares the from
email address.
Cake\Mailer\Email
$email
array
_prepareFromCmd( string $email )
Prepares the MAIL FROM
SMTP command.
$email
string
_prepareMessage( Cake\Mailer\Email $email )
Prepares the message body.
Cake\Mailer\Email
$email
string
_prepareMessageHeaders( Cake\Mailer\Email $email )
Prepares the message headers.
Cake\Mailer\Email
$email
array
_prepareRcptCmd( string $email )
Prepares the RCPT TO
SMTP command.
$email
string
_prepareRecipientAddresses( Cake\Mailer\Email $email )
Prepares the recipient email addresses.
Cake\Mailer\Email
$email
array
_sendData( Cake\Mailer\Email $email )
Send Data
Cake\Mailer\Email
$email
Cake\Network\Exception\SocketException
_sendRcpt( Cake\Mailer\Email $email )
Send emails
Cake\Mailer\Email
$email
Cake\Network\Exception\SocketException
_smtpSend( string|null $data , string|boolean $checkCode '250' )
Protected method for sending data to SMTP connection
$data
$checkCode
optional '250' string|null
Cake\Network\Exception\SocketException
connect( )
Connect to the SMTP server.
This method tries to connect only in case there is no open connection available already.
connected( )
Check whether an open connection to the SMTP server is available.
boolean
disconnect( )
Disconnect from the SMTP server.
This method tries to disconnect only in case there is an open connection available.
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:
[ [ 'code' => '250', 'message' => 'mail.example.com' ], [ 'code' => '250', 'message' => 'PIPELINING' ], [ 'code' => '250', 'message' => '8BITMIME' ], // etc... ]
array
send( Cake\Mailer\Email $email )
Send mail
Cake\Mailer\Email
$email
array
Cake\Network\Exception\SocketException
__construct( array $config [] )
Constructor
$config
optional [] _headersToString( array $headers , string $eol "\r\n" )
Help to convert headers in string
$headers
$eol
optional "\r\n" string
_configDelete( string $key )
Delete a single config key
$key
Cake\Core\Exception\Exception
_configRead( string|null $key )
Read a config variable
$key
mixed
_configWrite( string|array $key , mixed $value , boolean|string $merge false )
Write a config variable
$key
$value
$merge
optional false Cake\Core\Exception\Exception
config( string|array|null $key null , mixed|null $value null , boolean $merge true )
Reading the whole config:
$this->config();
Reading a specific value:
$this->config('key');
Reading a nested value:
$this->config('some.nested.key');
Setting a specific value:
$this->config('key', $value);
Setting a nested value:
$this->config('some.nested.key', $value);
Updating multiple config settings at the same time:
$this->config(['one' => 'value', 'another' => 'value']);
$key
optional null $value
optional null $merge
optional true mixed
Cake\Core\Exception\Exception
configShallow( string|array $key , mixed|null $value null )
Merge provided config with existing config. Unlike config()
which does a recursive merge for nested keys, this method does a simple merge.
Setting a specific value:
$this->config('key', $value);
Setting a nested value:
$this->config('some.nested.key', $value);
Updating multiple config settings at the same time:
$this->config(['one' => 'value', 'another' => 'value']);
$key
$value
optional null mixed
protected boolean
Whether the config property has already been configured with defaults
false
© 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/3.1/class-Cake.Mailer.Transport.SmtpTransport.html