我正在使用最新版本的CodeIgniter的wamp服務器。我已取消註釋從我的php.ini中說extension=php_openssl.dll
的行。我沒有安裝AVG防病毒。但它不起作用。我的電子郵件庫在我autoload.php自動加載在wamp服務器上用codeigniter發送郵件時出錯
我的郵件發送者控制:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Testmail extends CI_Controller {
public function index()
{
//configure email settings
$config['protocol'] = 'sendmail';
$config['smtp_host'] = 'ssl://smtp.gmail.com'; //smtp host name
$config['smtp_port'] = '465'; //smtp port number
$config['smtp_user'] = '[email protected]';
$config['smtp_pass'] = 'correct_password'; //$from_email password
$config['mailtype'] = 'html';
$config['charset'] = 'iso-8859-1';
$config['wordwrap'] = TRUE;
$config['newline'] = "\r\n"; //use double quotes
$this->email->initialize($config);
//send mail
$this->email->from('[email protected]', 'Mydomain');
$this->email->to('[email protected]');
$this->email->subject('testing mail');
$this->email->message('testing mail server class');
$this->email->send();
echo $this->email->print_debugger();
}
}
這是我當我打印的笨電子郵件調試程序錯誤消息的一部分。
A PHP Error was encountered
Severity: Warning
Message: fsockopen(): SSL operation failed with code 1. OpenSSL Error
messages: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown
protocol
Filename: libraries/Email.php
Line Number: 2063
的可能的複製的[Gmail的fsockopen():SSL操作與笨和XAMPP失敗的錯誤(https://stackoverflow.com/questions/34570064/gmail-fsockopen-ssl-operation-failed-error-with -codeigniter-and-xampp) – Joe
我按照概述的步驟操作,但不工作。 – dealwap