diff --git a/module/mail/control.php b/module/mail/control.php index 64eab60237..8f9955127c 100755 --- a/module/mail/control.php +++ b/module/mail/control.php @@ -11,6 +11,24 @@ */ class mail extends control { + /** + * Construct. + * + * @access public + * @return void + */ + public function __construct() + { + parent::__construct(); + + /* Task #1967. check the function of fsocket. */ + if(!function_exists('fsockopen')) + { + echo js::alert($this->lang->mail->nofsocket); + die(js::locate('back')); + } + } + /** * The index page, goto edit page or detect page. * diff --git a/module/mail/model.php b/module/mail/model.php index 7d0f7e3cea..77d6ce94ed 100644 --- a/module/mail/model.php +++ b/module/mail/model.php @@ -243,9 +243,6 @@ class mailModel extends model { if(!$this->config->mail->turnon) return; - /* Task #1967. check the function of fsocket. */ - if(function_exists('fsockopen')) die(js::alert($this->lang->mail->nofsocket)); - ob_start(); $toList = $toList ? explode(',', str_replace(' ', '', $toList)) : array(); $ccList = $ccList ? explode(',', str_replace(' ', '', $ccList)) : array();