diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php
index a7cc3a996b4..b5b15e3634b 100644
--- a/htdocs/core/class/html.formticket.class.php
+++ b/htdocs/core/class/html.formticket.class.php
@@ -1267,7 +1267,7 @@ class FormTicket
if (GETPOST('mode', 'alpha') == 'init' || (GETPOST('modelmailselected', 'alpha') && GETPOST('modelmailselected', 'alpha') != '-1')) {
if (!empty($arraydefaultmessage->joinfiles) && is_array($this->param['fileinit'])) {
foreach ($this->param['fileinit'] as $file) {
- $this->add_attached_files($file, basename($file), dol_mimetype($file));
+ $formmail->add_attached_files($file, basename($file), dol_mimetype($file));
}
}
}