diff --git a/htdocs/core/class/html.formsms.class.php b/htdocs/core/class/html.formsms.class.php
index 808c3fc4b8e..910460b4884 100644
--- a/htdocs/core/class/html.formsms.class.php
+++ b/htdocs/core/class/html.formsms.class.php
@@ -213,6 +213,7 @@ function limitChars(textarea, limit, infodiv)
else
{
dol_syslog("Warning: The SMS sending method has not been defined into MAIN_SMS_SENDMODE", LOG_WARNING);
+ $resultsender=array();
$resultsender[0]->number=$this->fromsms;
}