CodeIgniter电子邮件电子邮件助手不起作用

时间:2014-05-16 15:27:20

标签: php codeigniter email

我正在使用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

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

1 个答案:

答案 0 :(得分:0)

您可以尝试使用

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

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