diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index a507233630d..58161aef6f5 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -657,6 +657,12 @@ class CMailFile } else if ($this->sendmode == 'smtps') { + if (! is_object($this->smtps)) + { + $this->error="Failed to send mail with smtps lib to HOST=".$server.", PORT=".$conf->global->$keyforsmtpport."
Constructor of object CMailFile was not initialized without errors."; + dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR); + return false; + } // Use SMTPS library // ------------------------------------------