Welcome Guest, Not a member yet? Register   Sign In
Mail content is displaying in page
#1

After sending the mail , mail body is getting printed in the view
I am using SMTP mail and  parser library.

My code :
 
Code:
$this->load->library('parser');
  $mdata = array(
                             'templatename' => 'Email Verification',
                             'username'=>'xxxxxxxxxxx',
                              'link'=>'xxxxx',
                          );
   $message_body=$this->parser->parse_string($body, $mdata);
   //Configure EMAIL
   $config['protocol'] = 'mail';
   $config['mailtype'] = 'html';
   $config['priority']=1;
   $config['smtp_host'] = 'xxxxxx';
   $config['smtp_user'] = 'xxxxxx';
   $config['smtp_pass'] = 'xxxxx';
   $config['smtp_port'] = 465;
   $config['smtp_timeout'] = 5;  
   //Initialise Email
    $this->email->initialize($config);
  //Prepaire Email
    $this->email->from('xxxx', 'xxxx');
    $this->email->to('xxxxx');
    $this->email->subject('xxxx');
    $this->email->message($message_body);
  //Send the mail
     if($this->email->send()):
       $this->load->view('success_notice');
     else:
       redirect('failed','refresh');
     endif;

Note:  I have used xxxxx to mask the original data

Please look into it , and give me some solution
Thanks for your time !



 


   
Reply
#2

If you want to assign a view to a variable, you have to use a third parameter:
PHP Code:
   $message_body=$this->parser->parse_string($body$mdataTRUE); 
Reply




Theme © iAndrew 2016 - Forum software by © MyBB