【问题标题】:ION AUTH not sending forgot password e-mailION AUTH 不发送忘记密码的电子邮件
【发布时间】:2017-01-12 12:25:04
【问题描述】:

配置文件:

$config['use_ci_email'] = TRUE; 
$config['email_config'] = array(
    'protocol' => 'smtp',
    'smtp_host' => 'ssl://smtp.googlemail.com',
    'smtp_port' => 465,
    'smtp_user' => 'Myt E-mail Address',
    'smtp_pass' => 'My Correct Password',
    'mailtype' => 'html',
    'charset' => 'UTF-8'
);

图书馆:

$this->email->set_newline("\r\n");

错误:

fsockopen(): Peer certificate CN=`l2.iserverplanet.net' did not match expected CN=`smtp.googlemail.com'
fsockopen(): Failed to enable crypto
fsockopen(): unable to connect to ssl://smtp.googlemail.com:465 (Unknown error)

如何解决此错误以及为什么会出现此错误?请帮帮我。

【问题讨论】:

    标签: php codeigniter ion-auth


    【解决方案1】:
    $config = Array(
        'protocol' => 'smtp',
        'smtp_host' => 'ssl://smtp.googlemail.com',
        'smtp_port' => 465,
        'smtp_user' => 'xxx',
        'smtp_pass' => 'xxx',
        'mailtype'  => 'html', 
        'charset'   => 'iso-8859-1'
    );
    $this->load->library('email', $config);
    $this->email->set_newline("\r\n");
    
    // Set to, from, message, etc.
    
    $result = $this->email->send();
    

    还必须启用 SSL:

    extension=php_openssl.dll
    

    来源:Sending email with gmail smtp with codeigniter email library

    【讨论】:

      猜你喜欢
      • 2014-08-11
      • 2016-08-31
      • 2011-02-19
      • 2012-02-29
      • 2013-06-13
      • 1970-01-01
      • 1970-01-01
      • 2015-06-22
      • 2013-03-04
      相关资源
      最近更新 更多