where('name', 'email') ->find(); $config = unserialize($email_config['content']); $content = $config['template']; print_r($content); //所有项目必须填写 if (empty($config['smtp']) || empty($config['smtp_port']) || empty($config['smtp_user']) || empty($config['smtp_pwd'])) { return to_assign(1, '请完善邮件配置信息!'); } $send = send_email($sender, '测试邮件', $content); if ($send) { return to_assign(0, '邮件发送成功!'); } else { return to_assign(1, '邮件发送失败!'); } } }