test_email() public method

测试发送邮件
public test_email ( array $data ) : boolean
$data array 邮件相关内容数据
return boolean 是否发送成功
 function test_mail()
 {
     if (IS_POST) {
         require_once VENDOR_PATH . '/phpmailer/MailModel.class.php';
         $mail = new \MailModel();
         $result = $mail->test_email($_POST['config']['EMAIL_TEST_EMAIL']);
         if ($result === false) {
             $this->error($mail->message);
         } else {
             $this->success('发送成功');
         }
         exit;
     }
     $id = 6;
     $type = C('CONFIG_GROUP_LIST');
     $list[] = array("name" => "EMAIL_TEST_EMAIL", "title" => "测试邮件", "remark" => "请输入要发送的邮件地址", "type" => "1");
     $this->assign('list', $list);
     $this->assign('id', $id);
     $this->meta_title = $type[$id] . '设置';
     $this->display();
 }