why not send an email has HTML?
you must prepare the message first (I assume you are using POST)
$message = str_replace ("\r\n", "<br>", $this->input->post('message') );
or you can use native php way to get $_POST
$message = str_replace ("\r\n", "<br>", $_POST['message'] );
, <br>
config, :
$this->load->library('email');
$config['mailtype'] = 'html';
$this->email->initialize($config);
$this->email->from('your@example.com', 'Your Name');
$this->email->to('someone@example.com');
$this->email->subject('Email Test');
$this->email->message( $message );
$this->email->send();
! , ,
http://codeigniter.com/user_guide/libraries/email.html , , !
, , nl2br ->mailtype = 'html'; , :
$message = nl2br($this->input->post('message'));
$this->load->library('email');
$this->email->mailtype = 'html';
, , , CI , ->initialize. :
- application\config email.php
- , , :
'$config['mailtype'] = 'html';'
! ! , , mailtype. email config " Email Preferences . , application\config\autoload.php email, , , $this->load->library('email'); .