Using Cookbook - Mailer I managed to send CakePHP-mail using my hoster. No problem there.
I wanted to make an extra transport to send mail using gmail. Google-account is set to accept less secure apps. In app.php I added an EmailTransport as described in the cookbook:
‘gmail’ => [
‘host’ => ‘smtp.gmail.com’,
‘port’ => 587,
‘username’ => ‘email@example.com’,
‘password’ => ‘secret’,
‘className’ => ‘Smtp’,
‘tls’ => true
These settings seems equal to SMTP-settings Google is giving.
The email delivery profile stays untouched.
In the controller I setTransport to gmail, the other fields (like subject etc) are equal to those when using my hoster.
Using ‘tls=false’ gives:
So I guess SMTP-server is not accepting the connection.
Deliberatly using wrong account/password gives same error (tested succesfully account/password to login in google-account).
Using the ssl-setting given in the cookbook gives ‘an’ error too:
'host' => 'ssl://smtp.gmail.com', 'port' => 465, 'username' => 'firstname.lastname@example.org', 'password' => 'secret', 'className' => 'Smtp'
So what to do next?