Welcome Guest, Not a member yet? Register   Sign In
Email error
#1

[eluser]Miguel Diaz[/eluser]
Hi I hope someone can help me, I am making a website which have a regular contact form I am using the codeigniter function mail and a email controller that I did, normally this method that I use works in all hosting but now I am using it with a new client hosting and it doesnt work it send me and error



Message: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()



In this hosting, the database I had to use it with an IP address because it doesnt work the localhost do you think the error in the email is due the same problem?

Do you have any idea on how to put the ip address in the function mail instead of be using the localhost.

PLEASE HELP IS A REGULAR CONTACT FORM FOR A CLIENT. PLEASE HELP I REALLY APPRECIATE ALL SUPPORT YOU CAN GIVE ME. THKS

This is my email controller.

function send()
{
$this->load->library('form_validation');

// field name, error message, validation rules
$this->form_validation->set_rules('name', 'Nombre', 'trim|required');
$this->form_validation->set_rules('email', 'Email', 'trim|required|valid_email');

if($this->form_validation->run() == FALSE)
{
$op['title']= '.Tongueoder Joven:.';
$op['description']= '.Tongueoder Joven:.';
$op['keywords']= '.Tongueoder Joven:.';

//tags de scrypt extra por pagina//
$op['css']= '';
$op['js']= '';

// Vista de Template
$op['content'] = 'contacto-view';
$this->load->view('includes/template', $op);
}
else
{
// validation has passed. Now send the email
$name = $this->input->post('name');
$comentario = $this->input->post('Comment');
$email = $this->input->post('email');

//Conecta a la base de datos
$contactus = array('name' => $_POST['name'], 'email' => $_POST['email'], 'comentario' => $_POST['Comment']);
$this->db->insert('contactos', $contactus);


$this->load->library('email');
$this->email->set_newline("\r\n");

$this->email->from('[email protected]', 'Poder Joven');
$this->email->to($email);
$this->email->cc('[email protected]');
$this->email->bcc('[email protected]');
$this->email->subject('Poder Joven Formulario de Contacto.');
$this->email->message('¡Gracias por Contactarnos.!

Gracias por Contactarnos dentro de 24 Horas recibira una contestacion por parte de nosotros.

Su Opinion y Comentarios son valiosos para nosotros! !

Name: ' .$name. '
email: ' .$email. 'your comment was: ' .$comentario. '
' );

if($this->email->send())
{
// 'Your email was sent, Smile.';
$op['title']= '.Tongueoder Joven:.';
$op['description']= '.Tongueoder Joven:.';
$op['keywords']= '.Tongueoder Joven:.';

//tags de scrypt extra por pagina//
$op['css']= '';
$op['js']= '';

// Vista de Template
$op['content'] = 'confirmacion-view';
$this->load->view('includes/template', $op);
}

else
{
show_error($this->email->print_debugger());
}
}

}
#2

[eluser]WanWizard[/eluser]
How have you configured the email class?

If you haven't configured anything, it defaults to using sendmail via the mail() function, which requires a *nix host with local sendmail installed and running.

If you use a hoster that uses a central mailserver for all outgoing mail, you have to configure the smtp keys in the email config (see the documentation of the email library).




Theme © iAndrew 2016 - Forum software by © MyBB