From bd5c4603e315bf90d5412dea1b9bd589ed0bbd81 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 7 Aug 2020 17:06:12 +0200 Subject: [PATCH] Fix regression in sending emails --- htdocs/core/class/CMailFile.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 50418604c07..bc80d48d412 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -357,7 +357,7 @@ class CMailFile $smtps->setSubject($subjecttouse); $smtps->setTO($this->getValidAddress($this->to, 0, 1)); - $smtps->setFrom($this->getValidAddress($this->from, 0, 1)); + $smtps->setFrom($this->getValidAddress($this->addr_from, 0, 1)); $smtps->setTrackId($this->trackid); $smtps->setReplyTo($this->getValidAddress($this->replyto, 0, 1)); @@ -781,14 +781,14 @@ class CMailFile $from = $this->smtps->getFrom('org'); if ($res && !$from) { - $this->error = "Failed to send mail with smtps lib to HOST=".$server.", PORT=".$conf->global->$keyforsmtpport."
Sender address '$from' invalid"; + $this->error = "Failed to send mail with smtps lib to HOST=".$server.", PORT=".$conf->global->$keyforsmtpport." - Sender address '$from' invalid"; dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR); $res = false; } $dest = $this->smtps->getTo(); if ($res && !$dest) { - $this->error = "Failed to send mail with smtps lib to HOST=".$server.", PORT=".$conf->global->$keyforsmtpport."
Recipient address '$dest' invalid"; + $this->error = "Failed to send mail with smtps lib to HOST=".$server.", PORT=".$conf->global->$keyforsmtpport." - Recipient address '$dest' invalid"; dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR); $res = false; } @@ -811,7 +811,7 @@ class CMailFile else { if (empty($this->error)) $this->error = $result; - dol_syslog("CMailFile::sendfile: mail end error with smtps lib to HOST=".$server.", PORT=".$conf->global->$keyforsmtpport."
".$this->error, LOG_ERR); + dol_syslog("CMailFile::sendfile: mail end error with smtps lib to HOST=".$server.", PORT=".$conf->global->$keyforsmtpport." - ".$this->error, LOG_ERR); $res = false; } }