2017-01-23 5 views
0

を使用して電子メールを送信するときにsmtp.googlemail.com:465に接続することができません(接続がタイムアウトしました)取得エラーfsockopenの():smtp.googlemail.com:465に接続することができません(接続がタイムアウトした)私が間違っている可能性がいくつかの事がありますが、この問題が、運取得エラーfsockopenの():私はCodeIgniterのメールクラスを使用して電子メールを送信しようとしていますCodeIgniterの中に新しいですが、私はCodeIgniterのメールクラス

public function signup() 
{ 
    $this->form_validation->set_rules('email','Email','required|valid_email|is_unique[fbadmin.email]'); 
    $this->form_validation->set_error_delimiters("<p class='text-danger'>","</p>"); 
    if($this->form_validation->run()==TRUE) 
    { 
     $data= $this->input->post(); 
     unset($data['submit']); 
     //print_r($data);exit; 
     $this->load->model('Fbadminmodel'); 
     if($this->Fbadminmodel->signup($data)) 
     { 
      //$this->load->library('email'); 
      $config = array(
       'protocol' =>'smtp', 
       'smtp_host' =>'smtp.googlemail.com', 
       'smtp_port' =>'465', 
       'smtp_user' =>'[email protected]', 
       'smtp_pass' =>'password', 
       'mail_type' =>'html', 
       'charset' =>'utf-8' 
       ); 
      //$this->email->initialize($config); 
      $this->load->library('email', $config); 
      $this->email->from('[email protected]','Anuj Kumar'); 
      $this->email->to($data); 
      $this->email->message('www.haiviral.com'); 
      $this->email->set_newline("\r\n"); 

      if($this->email->send()) 
      { 
       //$this->session->set_flashdata('feedback','Succefully Registred. Please verify your email'); 
       echo "mail send"; 
      } 
      else 
      { 
       show_error($this->email->print_debugger()); 
      } 
     } 
     else 
     { 
      $this->load->view('fbadmin'); 
      $this->session->set_flashdata('feedback','Registration Failed'); 
     } 
     //$this->session->flashdata('flash','Email Sent'); 
     $this->load->view('fbadmin'); 
    } 
    else 
    { 
     echo validation_errors(); 
     $this->load->view('fbadmin'); 
    } 
} 
+0

を追加:としてあなたのポストを通過し、// smtp.googlemail.com'' // smtp.googlemail.com''、私はint型の値としてあなたのポストを渡すの意味を取得していないint型の値 – webDev

+0

php_openssl.dllは –

+0

メイク '「smtp_host」=>「SSL既に開いています申し訳ありません@ ShaileshSingh – webDev

答えて

0

を解決しようとしました。

$config = array(
    'smtp_timeout'=>'30', //<-- add this 
    'protocol' =>'smtp', 
    'smtp_host' =>'smtp.googlemail.com', 
    'smtp_port' =>'465', 
    'smtp_user' =>'[email protected]', 
    'smtp_pass' =>'password', 
    'mail_type' =>'html', 
    'charset' =>'utf-8' 
); 

次私がチェックするホスティングは、あなたがポート465にアクセスできるようにすることです:私はどうしたらまず最初は、あなたのsmtp_timeout設定が設定されている、それはまだ動作しない場合

$fp = fsockopen("smtp.gmail.com", 465, $errno, $errstr, 10); 
if (!$fp) 
    echo "smtp.gmail.com 465 - $errstr ($errno)<br>\n"; 

、I Gmailの2段階認証プロセスを無効にしようとします。

+0

'smtp_timeout' => '7'は既に電子メールクラスファイルに設定されていますが、同じエラー@daveが発生しています –

0

あなたに有効に拡張子が= php_openssl.dllのphp.iniと ` 'smtp_host' =>「SSLを確認してSSL

$emailConfig = [ 
     'protocol' => 'smtp', 
     'smtp_host' => 'ssl://smtp.googlemail.com', 
     'smtp_port' => 465, 
     'smtp_user' => '[email protected]', 
     'smtp_pass' => 'xxx', 
     'mailtype' => 'html', 
     'charset' => 'iso-8859-1' 
    ]; 
関連する問題