CodeIgniter Forums

Full Version: email-send(); - fsockopen error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Good afternoon guys,

when I send my contact form via "localhost " , is returning the following error:

Quote:A PHP Error was encountered
Severity: Warning
Message: fsockopen():
Filename: libraries/Email.php
Line Number: 1986
File: C:\wamp64\www\tpadua\application\controllers\contato.php
Line: 38
Function: send

File: C:\wamp64\www\tpadua\index.php
Line: 292
Function: require_once

location: config/email.php

//teste offline
$config['wordwrap'] = TRUE;
$config['smtp_user']='[email protected]';

location: controllers/contato/

public function enviar_contato(){
            $info['nome']         = $this->input->post('nome');
            $info['email']        = $this->input->post('email');
            $info['assunto']   = $this->input->post('assunto');
            $info['msg']          = $this->input->post('mensagem');


            $this->email->from($info['email'], $info['nome']);
            $this->email->to('[email protected]');
            $this->email->subject("E-mail de teste");
            $this->email->reply_to('[email protected]', 'E-mail resposta');
            $this->email->message($this->load->view('admin/contato', $info, TRUE));


I want to know if my setting is correct or is missing some configuration on my codeigniter .
For your SMTP host, try setting it like this:

PHP Code:
$config['smtp_host'] = 'ssl://'

PHP Code:
$config['smtp_host'] = 'ssl://'

I'm not sure this second one is correct, but you have specified the smtp host like that. You are just missing the ssl:// in front.