I'm trying to send email from a gmail account using CakEmail and SMTP settings .
It would be nice if someone tell the process step by step what to do .
I have added the following in app/Config/email.php=>
<?php
class EmailConfig {
public $smtp = array(
'host' => 'ssl://smtp.gmail.com',
'port' => 465,
'username' => '[email protected]',
'password' => 'secret'
);
}
Now how can i send email to any email account from "[email protected]" ?
It's CakePHP-2.0
From the docs:
You can configure SSL SMTP servers, like GMail. To do so, put the 'ssl://' at prefix in the host and configure the port value accordingly. Example:
<?php
class EmailConfig {
public $gmail = array(
'host' => 'ssl://smtp.gmail.com',
'port' => 465,
'username' => '[email protected]',
'password' => 'secret'
);
}
http://book.cakephp.org/2.0/en/core-utility-libraries/email.html?highlight=cakeemail#CakeEmail
The right configuration is:
public $gmail = array(
'host' => 'ssl://smtp.gmail.com',
'port' => 465,
'username' => '[email protected]',
'password' => 'secret',
'transport' => 'Smtp'
);
So, don't forget the transport element.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With