CodeIgniter Forums

Full Version: How to send an email with content from a View Ci4
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
When I use Ci3, I can use the script for send email with content from view like this :
Code:
$msg = $this->load->view('register/V_reset_password', $data, true);
$this->email->message($msg);

But in Ci4 that script cannot be used. I have to try like this and getting error :
Code:
$message = view('register/V_reset_password', $data, true);
$email->setMessage($message);
Please help to tell me what is a new code for send an email with content from view Ci4 ?
Thank you..

The code seems no problem.
What error message do you get?
Read this documentation, if the issue still is not resolved, then send in error message
https://codeigniter4.github.io/CodeIgnit...email.html
(09-27-2021, 12:58 AM)kenjis Wrote: [ -> ]The code seems no problem.
What error message do you get?

This is error message :
view(): Argument #3 ($options) must be of type array, bool given, called in
(09-27-2021, 03:57 AM)davis.lasis Wrote: [ -> ]Read this documentation, if the issue still is not resolved, then send in error message
https://codeigniter4.github.io/CodeIgnit...email.html

I have read it. But I cannot find how to send an email with content from a view file.
PHP Code:
$body view('yourView'$data);

$email->setMessage($body); 
(09-28-2021, 01:56 AM)InsiteFX Wrote: [ -> ]
PHP Code:
$body view('yourView'$data);

$email->setMessage($body); 
Thank you,
I have solved it before with only remove true... Shy