diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index 15a79d7fdd9..539bdca0036 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -687,7 +687,8 @@ if ($resql)
$formmail->withbody=1;
$formmail->withdeliveryreceipt=1;
$formmail->withcancel=1;
- // Tableau des substitutions
+ // Array of substitution
+ // TODO Use getCommonSubstitutionArray like in actions_sendmails.inc.php
$formmail->substit['__REF__']='__REF__'; // We want to keep the tag
$formmail->substit['__SIGNATURE__']=$user->signature;
$formmail->substit['__REFCLIENT__']='__REFCLIENT__'; // We want to keep the tag
diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php
index 26b5cbe3460..e5833295480 100644
--- a/htdocs/core/actions_massactions.inc.php
+++ b/htdocs/core/actions_massactions.inc.php
@@ -264,8 +264,8 @@ if (! $error && $massaction == 'confirm_presend')
}
$replyto = $from;
- $subject = GETPOST('subject');
- $message = GETPOST('message');
+ $subject = GETPOST('subject','none');
+ $message = GETPOST('message','none');
$sendtocc = GETPOST('sentocc');
$sendtobcc = '';
if ($objectclass == 'Propale') $sendtocc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO);
diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php
index 4986a093bac..18c951c7763 100644
--- a/htdocs/core/actions_sendmails.inc.php
+++ b/htdocs/core/actions_sendmails.inc.php
@@ -258,7 +258,8 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
}
$replyto = $_POST['replytoname']. ' <' . $_POST['replytomail'].'>';
- $message = $_POST['message'];
+ $message = GETPOST('message','none');
+ $subject = GETPOST('subject','none');
// Make a change into HTML code to allow to include images from medias directory with an external reabable URL.
//
@@ -278,7 +279,6 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
if ($action == 'send' || $action == 'relance')
{
- if (dol_strlen($_POST['subject'])) $subject = $_POST['subject'];
$actionmsg2=$langs->transnoentities('MailSentBy').' '.CMailFile::getValidAddress($from,4,0,1).' '.$langs->transnoentities('To').' '.CMailFile::getValidAddress($sendto,4,0,1);
if ($message)
{
diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php
index 9bfe00e6575..2555c44b539 100644
--- a/htdocs/core/class/html.formmail.class.php
+++ b/htdocs/core/class/html.formmail.class.php
@@ -302,10 +302,18 @@ class FormMail extends Form
if ($this->withform == 1)
{
$out.= '