【问题标题】:unable to send Email through codeigniter [closed]无法通过codeigniter发送电子邮件[关闭]
【发布时间】:2012-12-10 13:48:33
【问题描述】:

我正在使用带有 wamp 的 codeIgniter 作为本地服务器,我编写了发送电子邮件代码

 $config = array( 
      'protocol'=>'smtp',
      'smtp_port'=>'465',
      'smtp_host'=>'ssl://smtp.googlemail.com',
      'smtp_user'=>'myemail@gmail.com',
      'smtp_pass'=>'*********'
    );
    $this->load->library('email',$config);
    $this->email->set_newline("\r\n");//set the new line rule 
    $this->email->from('myemail@gmail.com', 'Imran Tufail');
    $this->email->to('myemail@gmail.com');

    $this->email->subject('Email Test');
    $this->email->message("The stuff works");

    if($this->email->send())
    {
         echo "Mail sent ";
    }
    else{
    echo $this->email->print_debugger();
        }
    }

此代码正在生成错误

A PHP Error was encountered
Severity: Warning
Message: fsockopen(): unable to connect to ssl://smtp.googlemail.com:465 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?)

文件名:libraries/Email.php

行号:1869

遇到以下 SMTP 错误:1706213911 无法找到套接字传输“ssl” - 您在配置 PHP 时是否忘记启用它?

【问题讨论】:

    标签: codeigniter smtp wampserver


    【解决方案1】:

    我解决了我的问题。因为我们使用的是 ssl smtp 并且没有在 wamp 服务器中启用 ssl 扩展

    所以转到任务栏中的 wanpserver 图标,

      wampserver->php->phpextansions-> then check the php_openssl extansion
    

    【讨论】:

    • 解决了你的问题还是你需要任何帮助............
    • thnx venkat 我的问题解决了
    猜你喜欢
    • 2018-10-12
    • 2013-05-28
    • 2012-12-05
    • 1970-01-01
    • 1970-01-01
    • 2012-04-11
    • 2013-02-21
    • 1970-01-01
    • 2020-07-10
    相关资源
    最近更新 更多