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;
}
}