views:

26

answers:

1

Hello. I'm trying to send an e-mail with Codeigniter like this:

$this->load->library('email');

$this->email->from("[email protected]");
$this->email->reply_to("[email protected]");
$this->email->to("[email protected]");
$this->email->subject("Test mail");
$this->email->message("Email body");
$this->email->set_alt_message("Email body txt");
$this->email->send();

and I got this on the email debugger: Unable to send email using PHP mail(). Your server might not be configured to send mail using this method.

If I do e simple PHP mail() function with the same addresses, it works but when I use CodeIgniter it gives me the error. So why would it work with simple mail() but not with CodeIgniter ? Any ideas ?

Thanks.

+2  A: 

Do you have an email.php file in your config folder? Maybe there's a problem with your configuration in there.

mseo
Yes, I do have an email.php config, it's default and holds only these: $config['mailtype'] = 'html';$config['charset'] = 'utf-8';$config['newline'] = '\r\n';
Manny Calavera
Maybe you should try $config['mailtype'] = 'text'; The mailtype html already caused some problems for me. Or try deleting the whole config file to use default settings.
mseo
I will try that, thanks. But I shouldn't have this problem, I want to be able to send HTML message if needed. And I can do it with mail(), and it's bad that I can't do it with such large framework. I still wonder if I am doing something wrong.
Manny Calavera