2017-06-15 11 views
0

最新バージョンのCodeIgniterでwampサーバを使用しています。私はextension=php_openssl.dllというphp.iniの行のコメントを外しました。私はAVGウイルス対策がインストールされていません。それでも動作しません。これは私がCodeIgniterのメールデバッガを印刷したときに私が得たエラーメッセージの一部であるワームサーバで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(); 
} 


} 

:私は、電子メールのライブラリは私のautoload.phpに

マイメール送信者のコントローラを自動的にロードできます。

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 
+0

の可能性のある重複[GMailのfsockopenの():SSL操作がCodeIgniterのとXAMPPでエラーに失敗](https://stackoverflow.com/questions/34570064/gmail-fsockopen-ssl-operation-failed-error-with -codeigniter-and-xampp) – Joe

+0

私は説明した手順に従ってきましたが、機能していません。 – dealwap

答えて

0

私は以下のコードを使用しました。それは正常に働いています。プロトコルをsmtpに変更します。また、コードにssl://を削除してみてください。

$config = array(
     'protocol' => 'smtp', 
     'smtp_host' => 'ssl://just127.justhost.com', 
     'smtp_port' => 465, 
     'smtp_user' => '[email protected]', 
     'smtp_pass' => 'yourpassword', 
     'mailtype' => 'html', 
     'charset' => 'iso-8859-1' 
); 
+0

私は電子デバッガから '421サーバビジーが多すぎます。 – dealwap

+0

私は私の答えを編集しました。それに従ってください。 – kazinayem2011

関連する問題