diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php
index f5408bceff1..6a4d25f0a59 100644
--- a/htdocs/core/class/html.formmail.class.php
+++ b/htdocs/core/class/html.formmail.class.php
@@ -448,9 +448,11 @@ class FormMail extends Form
// Zone to select email template
if (count($modelmail_array) > 0)
{
+ $model_mail_selected_id = GETPOSTISSET('modelmailselected') ? GETPOST('modelmailselected', 'int') : $arraydefaultmessage->id;
+
// If list of template is filled
$out .= '