• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Send HTML email but showing souce code ?

#1
Exclamation 
:huh:
I dont know my wrong, but when send email HTML using showing as source code.

Please help me

my code :


Code:
$config = array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => $sender_email,
'smtp_pass' => $user_password,
'mailtype' => 'html',
'wordwrap' => TRUE,
'charset' => 'iso-8859-1',
'newline' => '\r\n'
);

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

$this->email->from($sender_email, $sender_name);
$this->email->to($to_email);
$this->email->subject($subject_mail);
$body = $this->load->view('email',null,TRUE);

$this->email->message($body);
if (!$this->email->send()){
echo 'fail to load email';
}
else {
echo 'success to send email';
}
Reply

#2
Try this, change
PHP Code:
$this->load->library('email'$config); 
with
PHP Code:
$this->load->library('email');
$this->email->initialize($config); 
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.