简体   繁体   中英

Issue with sending codeigniter view in email

I am trying to send email in codeigniter. I'm sending view in message body.But I'm getting error as shown below:

错误

It displaying view below the error. My code is as below.

$msg = $this->load->view('FolderName/sendEmail.php',TRUE); 

I have also tried

$msg = $this->load->view('FolderName/sendEmail.php',"",TRUE);

But with this code I'm not receiving any email. Please help me to find out the solution.

I suggest two changes:

If the view file has a php extension, you should remove the .php from the first parameter (just use $this->load->view('FolderName/sendEmail'); ).

Also, you need to pass an empty second parameter if you're not passing data from the controller to the view, as the TRUE parameter you are using in order to get the HTML back in the controller is the third parameter, not the second.

try $this->load->view('FolderName/sendEmail, NULL, TRUE');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM