12-23-2014, 03:27 PM
hi all,
I'm sending email with CI but I can't get html tags as I want.
here is my code
this is my Model folder
and this my success mesage php page
in received email I'm getting back the page as it is likethis
instead something like tthis
and
what did I make wrong,? something with header content type maybe? Can someone help me with this?
I'm sending email with CI but I can't get html tags as I want.
here is my code
this is my Model folder
PHP Code:
##forgot password send email
public function forgot_pass($email) {
$this->form_validation->set_rules('email_f_f_pass','email','required|valid_email|is_unique[users.email]|trim');
if($this->form_validation->run() == TRUE && !empty($email) ){
$config = Array(
'protocol' => 'sendmail',
'mailtype' => 'html',
'charset' => 'utf-8',
'wordwrap' => TRUE
);
$message = $this->load->view('admin/ad_pages/send_email', '', true);
$this->load->library('email', $config);
$this->email->set_newline("\r\n");
$this->email->from(@$email);
$this->email->to('[email protected]');
$this->email->subject('send email to costomer');
$this->email->message($message);
if($this->email->send()){
echo'<div style="position:relative; top:50px; width:330px; margin:0 auto;" class="alert alert-dismissable alert-danger">
<button type="button" class="close" data-dismiss="alert">x</button>
<strong>success!</strong> Please, check your email for new password !!!
</div>';
$this->output->set_header('refresh:3; url='.base_url().'admin/admin_pages/login');
}else{
show_error($this->email->print_debugger());
}
}else{
$this->load->view('admin/ad_pages/forgot_pass');
}
}
and this my success mesage php page
PHP Code:
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<h1>success</h1>
<p>your message send <b>successfuly!!</b></p>
</body>
</html>
in received email I'm getting back the page as it is likethis
Code:
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<h1>success</h1>
<p>your message send <b>successfuly!!</b></p>
</body>
</html>
instead something like tthis
Code:
[b]success[/b] big like h1 expected
Code:
your message send [b]successfuly!![/b]
what did I make wrong,? something with header content type maybe? Can someone help me with this?