diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index e906fc7f7a6..df6d0b84235 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1182,7 +1182,7 @@ class FormMail extends Form { global $conf, $langs; //if (! $this->errorstomail) $this->errorstomail=$this->frommail; - $errorstomail = (!empty($conf->global->MAIN_MAIL_ERRORS_TO) ? $conf->global->MAIN_MAIL_ERRORS_TO : $this->errorstomail); + $errorstomail = getDolGlobalString('MAIN_MAIL_ERRORS_TO', (!empty($this->errorstomail) ? $this->errorstomail : '')); if ($this->witherrorstoreadonly) { $out = '