Send mail using SMTP protocol
Cake\Mailer\Transport\SmtpTransport __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|nullCake\Network\Exception\SocketExceptionconnect( )
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.
booleandisconnect( )
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...
]
arraysend( Cake\Mailer\Email $email )
Send mail
Cake\Mailer\Email $email arrayCake\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\Exceptionconfig( 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 mixedCake\Core\Exception\ExceptionconfigShallow( 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 mixedprotected 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