I have a problem sending emails with the mail function of codeigniter. On all my CI websites the same code works except on nordia.be. All my websites are on the same provider and I tested with a simple php mail form and that works! Any suggestions? This is my code. Strange that it's been succesfully send but I don't receive a mail?
function sendmail2(){
$message = "Aanvraag van: ".$this->input->post('inputName')."
";
$message .= "Telefoon nr: ".$this->input->post('inputTel')."
";
$message .= "Email: ".$this->input->post('inputEmail')."
";
$message .= "Bericht: ".$this->input->post('inputBericht')."
";
$this->load->library('email');
$this->email->from($this->input->post('inputEmail'),$this->input->post('inputName'));
$this->email->to('kristof@email.be');
$this->email->subject('nordia vraag!');
$this->email->message($message);
$this->email->send();
echo $this->email->print_debugger();
}
Your message has been successfully sent using the following protocol: mail
User-Agent: CodeIgniter
Date: Thu, 8 Jan 2015 12:03:50 +0000
From: "sds" <kristof@kspl.be>
Return-Path: <kristof@kspl.be>
Reply-To: "kristof@kspl.be" <kristof@kspl.be>
X-Sender: kristof@kspl.be
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <54ae72265f227@kspl.be>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
=?iso-8859-1?Q?nordia_vraag!?=
Aanvraag van: sds
Telefoon nr: dsdsd
Email: kristof@kspl.be
Bericht: sds
Have you set your email config http://www.codeigniter.com/user_guide/libraries/email.html
You need to add email config to make it work.
Also if you are using xampp or wampp here you can watch tutorial. https://www.youtube.com/watch?v=TO7MfDcM-Ho
$config['protocol'] = 'sendmail';
$config['mailpath'] = '/usr/sbin/sendmail';
$config['charset'] = 'iso-8859-1';
$config['wordwrap'] = TRUE;
$this->email->initialize($config);