mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Avoid undefined index if not define timeout in EmailComponent. Fixes #779
This commit is contained in:
parent
7682c5896e
commit
b480d80c82
1 changed files with 8 additions and 4 deletions
|
@ -228,9 +228,7 @@ class EmailComponent extends Object{
|
|||
* @access public
|
||||
* @link http://book.cakephp.org/view/1290/Sending-A-Message-Using-SMTP
|
||||
*/
|
||||
var $smtpOptions = array(
|
||||
'port'=> 25, 'host' => 'localhost', 'timeout' => 30
|
||||
);
|
||||
var $smtpOptions = array();
|
||||
|
||||
/**
|
||||
* Placeholder for any errors that might happen with the
|
||||
|
@ -789,7 +787,13 @@ class EmailComponent extends Object{
|
|||
function _smtp() {
|
||||
App::import('Core', array('CakeSocket'));
|
||||
|
||||
$this->__smtpConnection =& new CakeSocket(array_merge(array('protocol'=>'smtp'), $this->smtpOptions));
|
||||
$defaults = array(
|
||||
'host' => 'localhost',
|
||||
'port' => 25,
|
||||
'protocol' => 'smtp',
|
||||
'timeout' => 30
|
||||
);
|
||||
$this->__smtpConnection =& new CakeSocket(array_merge($defaults, $this->smtpOptions));
|
||||
|
||||
if (!$this->__smtpConnection->connect()) {
|
||||
$this->smtpError = $this->__smtpConnection->lastError();
|
||||
|
|
Loading…
Add table
Reference in a new issue