1
[CAKEPHP 2] Hello guys, I’m having a problem sending email on a website that is hosted, the local server works normally, but once it gets hosted it doesn’t work. I did the hosting by goddady, someone already went through this problem?
email.php:
class EmailConfig {
public $smtp = array(
'transport' => 'Smtp',
'from' => array('[email protected]' => 'Matheus'),
'host' => 'smtp.gmail.com',
'port' => 587,
'timeout' => 30,
'username' => '[email protected]',
'password' => '*********',
'client' => null,
'log' => false,
'charset' => 'utf-8',
'headerCharset' => 'utf-8',
'tls' => 1,
);
}
Error:
Connection refused Error: An Internal Error Has Occurred. Stack Trace CORE/Cake/Network/Email/Smtptransport.php line 154 Cakesocket->connect() CORE/Cake/Network/Email/Smtptransport.php line 95 Smtptransport->_connect() CORE/Cake/Network/Email/Cakeemail.php line 1161 Smtptransport->send(Cakeemail) APP/Controller/Pagescontroller.php line 58 Cakeemail->send() [Internal Function] Pagescontroller->home() CORE/Cake/Controller/Controller.php line 490 Reflectionmethod->invokeArgs(Pagescontroller, array) CORE/Cake/Routing/Dispatcher.php line 193 Controller->invokeAction(Cakerequest) CORE/Cake/Routing/Dispatcher.php line 167 Dispatcher->_invoke(Pagescontroller, Cakerequest) APP/webroot/index.php line 108 Dispatcher->Dispatch(Cakerequest, Cakeresponse)
Try this ssl://smtp.gmail.com host and port 465 to see if it works
– Andre
Keep on making the same mistake...
– Matheus Ferreira