【问题标题】:error sending email in codeigniter 3 and php 7在 codeigniter 3 和 php 7 中发送电子邮件时出错
【发布时间】:2019-11-11 03:18:13
【问题描述】:
$config = [
        'protocol'      =>  'sendmail',
        'smtp_host'     =>  'ssl://smtp.googlemail.com',
        'smtp_user'     =>  '***************',
        'smtp_pass'     =>  '********',
        'smtp_port'     =>   465,
        'smtp_timeout'  =>  '30', 
        'mailtype'      =>  'html',
        // 'ssl'            =>  [
        //                      'verify_peer'       => false,
        //                      'veriry_peer_name'  => false,
        //                      'allow_self_sign'   => true
        //                  ],// ini hanya jika jaringa tidak ssl/https, jangan dilakukan di produksi
        'starttls'      =>  true,
        'charset'       =>  'utf-8',
        'newline'       =>  "\r\n"
    ];

大家好,我有 我试图从我的本地主机发送邮件,但它返回如下错误,

消息:stream_socket_enable_crypto():SSL/TLS 已为此流设置

谢谢你的帮助,

【问题讨论】:

    标签: codeigniter-3 php-7.3


    【解决方案1】:

    为了从本地发送邮件,我使用的是 SMTP。请使用以下代码更改您的代码。它对我有用。不要编辑系统文件。这将在未来给您带来麻烦。

    $config['protocol'] = 'smtp';
    $config['smtp_host'] = 'ssl://smtp.googlemail.com';
    $config['smtp_user'] = '********'; //your email id
    $config['smtp_pass'] = '********'; //email id password
    $config['smtp_port'] = 465; 
    $config['smtp_timeout'] = 5;
    $config['wordwrap'] = TRUE;
    $config['wrapchars'] = 76;
    $config['mailtype'] = 'html';
    $config['charset'] = 'utf-8';
    $config['validate'] = FALSE;
    $config['priority'] = 3;
    $config['crlf'] = "\r\n";
    $config['newline'] = "\r\n";
    $config['bcc_batch_mode'] = FALSE;
    $config['bcc_batch_size'] = 200;
    

    【讨论】:

      猜你喜欢
      • 2012-12-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-12-28
      • 2012-11-21
      • 1970-01-01
      相关资源
      最近更新 更多