【问题标题】:CodeIgniter email Email helper doesn't workCodeIgniter 电子邮件电子邮件助手不起作用
【发布时间】:2014-07-05 03:11:50
【问题描述】:

我正在开发 Codeigniter 上的密码重置功能,我是这个框架的新手,但我已经按照这里的所有说明操作:

$email= $this->input->post('email');

 $this->load->helper('string');
 $rs= random_string('alnum', 12);

 $data = array(
           'password' => md5($rs)
         );

 $this->db->where('email', $email);
 $this->db->update('user', $data);

 //now we will send an email

  $config['protocol'] = 'smtp';
  $config['smtp_host'] = 'My SMTP Host';
  $config['smtp_port'] = 465;
  $config['smtp_user'] = '***@gmail.com';
  $config['smtp_pass'] = 'Account Password';

  $this->load->library('email', $config);
  $this->email->initialize($config);
  $this->email->from('info@link-sa.ga');
  $this->email->to($email);

  $this->email->subject('Mot de passe oublier');
  $this->email->message('Votre Nouveau mot de passe est :'.$rs );

  $this->email->send();

这是调试页面:

https://docs.google.com/file/d/0B2keUK5KhVo8MUg3WVJKemZPcEE/edit?usp=drivesdk

我确定所有的邮件服务器信息都是正确的,但是邮件没有发送给用户,希望你能帮助我,谢谢大家

【问题讨论】:

  • echo $this->email->print_debugger();
  • 也许试试 587 端口而不是 465。
  • 从您的调试看来您的 smtp 凭据不正确

标签: php codeigniter email


【解决方案1】:

你可以试试

$config['smtp_port'] = '587';
$config['smtp_host'] = 'ssl://smtp.gmail.com';

更多信息https://support.google.com/mail/answer/13287http://ellislab.com/forums/viewthread/84689/P0/

【讨论】:

猜你喜欢
  • 2015-11-03
  • 1970-01-01
  • 2017-10-21
  • 1970-01-01
  • 1970-01-01
  • 2018-07-10
  • 2016-07-15
  • 2018-08-06
  • 2016-05-27
相关资源
最近更新 更多