1

Codeigniter Email Class is not working on localhost

Errors

  1. Message: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed

  2. Message: fsockopen(): Failed to enable crypto

  3. Message: fsockopen():unable to connect to ssl://smtp.googlemail.com:465 (Unknown error)


public function index()
{
    $config = Array(
        'protocol' => 'smtp',
        'smtp_host' => 'ssl://smtp.googlemail.com',
        'smtp_port' => 465,
        'smtp_user' => 'fahadahmedkhan7223@gmail.com',
        'smtp_pass' => '********', 
        'mailtype' => 'html',
        'charset' => 'iso-8859-1',
        'wordwrap' => TRUE
    );

    $this->load->library('email', $config);
    $this->email->set_newline("\r\n");
    $this->email->from('fahadahmedkhan7223@gmail.com');
    $this->email->to('fahadahmedkhan7223@gmail.com');
    $this->email->subject('Test');
    $this->email->message("This is test of codeigniter email class.");

    if($this->email->send())
    {
        echo 'Email sent.';
    }
    else
    {
        show_error($this->email->print_debugger());
    }

}
  • Help me. i try every thing, but it still not working. :( – Fahad Ahmed Khan Oct 21 '17 at 15:34
  • Did you set up the sendmail config on localhost you might need to configure the local host send mail https://www.youtube.com/watch?v=TO7MfDcM-Ho –  Oct 21 '17 at 20:42
  • Message: fwrite(): send of 6 bytes failed with errno=10053 An established connection was aborted by the software in your host machine. – Fahad Ahmed Khan Oct 23 '17 at 07:08
  • '$config = Array( 'protocol' => 'smtp', 'smtp_host' => 'smtp.googlemail.com', 'smtp_port' => 465, 'smtp_user' => 'waqardeveloper4@gmail.com', 'smtp_pass' => '********', 'mailtype' => 'html' ); $this->load->library('email', $config); $this->email->set_newline("\r\n");' – Fahad Ahmed Khan Oct 23 '17 at 07:12
  • Still not working :( – Fahad Ahmed Khan Oct 23 '17 at 07:13

0 Answers0