0
votes
 $config['protocol'] = 'smtp';
    $config['smtp_host'] = 'smtp_host';
    $config['smtp_port'] = 25;
    $config['smtp_user'] = 'smtp_user';
    $config['smtp_pass'] = '$$$';
    $this->load->library('email', $config);
    $this->email->initialize($config);

    $this->email->from($config['smtp_user']);
    $this->email->to('[email protected]');
    $this->email->subject('TEST MAIL');

    $this->email->message('TESTING OF MAIL');

    if ($this->email->send()) {
        return true;
    } else {
        return false;
    }

This is my code for sending email. I got below error.

Message: fsockopen(): unable to connect to box334.bluehost.com:25 (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. )

1

1 Answers

0
votes

You email server is not responding properly. try to check your email server setting like smtp PORT, SMTP HOST and USER etc.