2016-12-04 25 views
0

libにメールのCodeIgniterを実装しながら、私のログファイルには、このエラーを示していますSSLに接続することができません://smtp.googlemail.com:25

ERROR - 2016-12-03 03:22:10 --> Severity: Warning --> fsockopen(): SSL operation failed with code 1. OpenSSL Error messages: 
error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol E:\xampp\htdocs\verime_v11\system\libraries\Email.php 2014 
ERROR - 2016-12-03 03:22:10 --> Severity: Warning --> fsockopen(): Failed to enable crypto E:\xampp\htdocs\verime_v11\system\libraries\Email.php 2014 
ERROR - 2016-12-03 03:22:10 --> Severity: Warning --> fsockopen(): unable to connect to ssl://smtp.googlemail.com:25 (Unknown error) E:\xampp\htdocs\verime_v11\system\libraries\Email.php 2014 

マイコード:

$subject  = $this->input->post('subject'); 
$name  = $this->input->post('name'); 
$email = $this->input->post('email'); 
$feedback = $this->input->post('feedback'); 
$created_date = date('Y-m-d'); 

$insertcontact_array = array(
    'subject'  => $subject, 
    'name'  => $name, 
    'email'  => $email, 
    'feedback' => $feedback, 
    'created_date'=> $created_date, 
); 

$config = array(
    'protocol' => 'smtp', 
    'smtp_host' => 'ssl://smtp.googlemail.com', 
    'smtp_port' => '25', 
    'smtp_user' => '[email protected]', 
    'smtp_pass' => 'developer' 
); 

$this->load->library('email',$config); 
$this->email->set_newline("\r\n"); 
$this->email->from($email); 
$this->email->to('[email protected]'); 
$this->email->subject($subject); 
$this->email->message($feedback); 

if($this->email->send()) 
{ 
    $result = $this->db->insert('tblcontactus', $insertcontact_array); 
    if(!empty($result)) 
    { 
     return 1; 
    }else 
    { 
     return 0; 
    } 
}else 
{ 
    show_error($this->email->print_debugger()); 
} 

任意のヘルプ?

+0

。コードに入る前に何らかの文脈を持つことは、いつでも役立ちます。良い質問をするためのヒントについては、[質問]を参照してください。また、何をしようとしているのかについてさらに説明を加えることを検討してください。実際のエラーメッセージが表示されるようにタイトルを更新しました。意見を得るためには良いタイトルが重要です。がんばろう! – Chris

答えて

1
にあなたの設定を変更し

:私はあなたの質問のトップにあなたのエラーを動かし

$config = array(
    'protocol' => 'smtp', 
    'smtp_host' => 'smtp.googlemail.com', 
    'smtp_port' => '587', 
    'smtp_user' => '[email protected]', 
    'smtp_pass' => 'developer' 
); 

Note:
1. removed the ssl://
2. change port from 25 to 287

+0

お返事ありがとうございました@Dekel。私はこれを試しましたが、ログファイルにエラーは表示されませんが、何も応答しませんでした。 –

+0

今うまく働いています。おめでとう@Dekel。 –

関連する問題