diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 9c9cbdafc4174..b1cbbc4878211 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -627,7 +627,7 @@ public function get_form($addfileaction = 'addfile', $removefileaction = 'remove // Add also email aliases from the c_email_senderprofile table $sql = "SELECT rowid, label, email FROM ".$this->db->prefix()."c_email_senderprofile"; - $sql .= " WHERE active = 1 AND (private = 0 OR private = ".((int) $user->id).")"; + $sql .= " WHERE active = 1 AND (private = 0 OR private = ".((int) $user->id).") AND entity in (0, ".((int) $conf->entity).")"; $sql .= " ORDER BY position"; $resql = $this->db->query($sql); if ($resql) {