I'm trying to set up cakephp to send emails via < I have already done some research and have not yet had success in the result, someone could you help me?
I'm trying to set up cakephp to send emails via < I have already done some research and have not yet had success in the result, someone could you help me?
In your app/Config/email.php
file you will need to create the EmailConfig
class.
The file app/Config/email.php.default
is an example of how it should look.
You should create a new setting called gmail with the following code
public $gmail = array(
'host' => 'ssl://smtp.gmail.com',
'port' => 465,
'username' => '[email protected]', // seu email no gmail
'password' => 'senha', // sua senha no gmail
'transport' => 'Smtp'
);
For connections tls you will need to include 'tls' => true
in your configuration;
If your cakephp is 2.3.0 or higher use:
public $gmail = array(
'host' => 'smtp.gmail.com',
'port' => 465,
'username' => '[email protected]',
'password' => 'secret',
'transport' => 'Smtp',
'tls' => true
);
See that it uses tls = > true, for previous version use:
public $gmail = array(
'host' => 'ssl://smtp.gmail.com',
'port' => 465,
'username' => '[email protected]',
'password' => 'secret',
'transport' => 'Smtp'
);
This in the /app/Config/email.php class according to cakephp documentation: link