Reputation: 2662
I'm using the following code for sending mail in codeigniter
$this->load->library('email');
$this->email->set_mailtype('html');
$this->email->from('[email protected]', 'Your Name');
$this->email->to('[email protected]');
$this->email->subject('Email Test');
$this->email->message('Testing the email class.');
$this->email->send();
echo $this->email->print_debugger();
Here I'm getting the error as
Unable to send email using PHP mail(). Your server might not be configured to send mail using this method.
But if the mail type is change to text, ie
$this->email->set_mailtype('text');
It works fine.Why is it so ?
Upvotes: 2
Views: 1626
Reputation: 1
Need an email.php file.
$config['protocol'] = 'sendmail';
$config['mailpath'] = '/usr/sbin/sendmail';
$config['charset'] = 'iso-8859-1';
$config['wordwrap'] = TRUE;
reference, this URL: http://www.ciboard.co.kr/user_guide/en/libraries/email.html
Upvotes: 0
Reputation: 143
$config['charset'] = 'utf-8';
$config['wordwrap'] = TRUE;
$config['mailtype'] = 'html';
$this->email->initialize($config);
Try this.
Upvotes: 1