diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index 3365762714a..a00b65dae72 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -314,11 +314,11 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO $fromtype = GETPOST('fromtype', 'alpha'); $emailsendersignature = ''; if ($fromtype === 'robot') { - $from = dol_string_nospecial($conf->global->MAIN_MAIL_EMAIL_FROM, ' ', array(",")).' <' . getDolGlobalString('MAIN_MAIL_EMAIL_FROM').'>'; + $from = dol_string_nospecial(getDolGlobalString('MAIN_MAIL_EMAIL_FROM'), ' ', array(",")).' <' . getDolGlobalString('MAIN_MAIL_EMAIL_FROM').'>'; } elseif ($fromtype === 'user') { $from = dol_string_nospecial($user->getFullName($langs), ' ', array(",")).' <'.$user->email.'>'; } elseif ($fromtype === 'company') { - $from = dol_string_nospecial($conf->global->MAIN_INFO_SOCIETE_NOM, ' ', array(",")).' <' . getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>'; + $from = dol_string_nospecial(getDolGlobalString('MAIN_INFO_SOCIETE_NOM'), ' ', array(",")).' <' . getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'>'; } elseif (preg_match('/global_aliases_(\d+)/', $fromtype, $reg)) { $tmp = explode(',', getDolGlobalString('MAIN_INFO_SOCIETE_MAIL_ALIASES')); $from = trim($tmp[((int) $reg[1] - 1)]); @@ -344,8 +344,9 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO } $replyto = ''; - if (GETPOST('replytoname')) { - $replyto = dol_string_nospecial(GETPOST('replytoname'), ' ', array(",")).' <'.GETPOST('replytomail').'>'; + if (GETPOST('replytomail')) { + $replyto = dol_string_nospecial(GETPOST('replytoname'), ' ', array(",")); + $replyto .= ($replyto ? ' ' : '').'<'.GETPOST('replytomail').'>'; } $message = GETPOST('message', 'restricthtml');