我想向经管理员验证的用户发送电子邮件。当管理员单击数据库中的验证按钮时,用户的状态已更改,并且电子邮件发送给用户,状态可以更改,但电子邮件未发送。
AdminController:
if($this->AdminModel->updateUser($id , $status)){
$user_message = "hello";
$this->load->library('email');
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'ssl://smtp.gmail.com';
$config['smtp_port'] = '465';
$config['smtp_timeout'] = '7';
$config['smtp_user'] = 'kshahroz699@gmail.com';
$config['smtp_pass'] = 'password';
$config['charset'] = 'utf-8';
$config['newline'] = "\r\n";
$config['mailtype'] = 'text'; // or html
$config['validation'] = TRUE;
$this->email->initialize($config);
$this->email->from('kshahroz699@gmail.com', 'Model Hunt Inquiry');
$this->email->to($email);
$this->email->subject('Model Hunt Inquiry Form');
$this->email->message($user_message);
if($this->email->send()) {
echo " Successfully send";
}else{
echo "Not Send";
}
AdminModel:
function updateUser($id, $data){
$this->db->where('id',$id);
return $this->db->update('mh_users',$data);
}
路线:
$route['verifyUserEmail/(:any)/(:any)'] = 'Admin/verifyEmail/$1/$2';
答案 0 :(得分:0)
管理员模型
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let destViewController : SearchViewController = storyboard.instantiateViewController(withIdentifier: "SearchViewController") as! SearchViewController
destViewController.getSearchTxt = self.tagsData[indexPath.row]
// destViewController.modalPresentationStyle = .currentContext
destViewController.modalPresentationStyle = .overCurrentContext
self.navigationController!.pushViewController(destViewController, animated: true)
我的控制器
self.view.isOpaque = false
self.view.backgroundColor = .clear