diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php
index 8ea76bb4fcb..55345d68cc7 100644
--- a/htdocs/core/class/html.formmail.class.php
+++ b/htdocs/core/class/html.formmail.class.php
@@ -859,7 +859,7 @@ class FormMail extends Form
if (! GETPOST('modelselected','alpha') || GETPOST('modelmailselected') != '-1')
{
if ($arraydefaultmessage && $arraydefaultmessage->content) {
- $defaultmessage = $arraydefaultmessage['content'];
+ $defaultmessage = $arraydefaultmessage->content;
} elseif (! is_numeric($this->withbody)) {
$defaultmessage = $this->withbody;
}