Welcome Guest, Not a member yet? Register   Sign In
How to send an email with content from a View Ci4
#1

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..

Reply
#2

The code seems no problem.
What error message do you get?
Reply
#3

Read this documentation, if the issue still is not resolved, then send in error message
https://codeigniter4.github.io/CodeIgnit...email.html
Reply
#4

(This post was last modified: 09-27-2021, 07:28 PM by naldi.)

(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
Reply
#5

(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.
Reply
#6

PHP Code:
$body view('yourView'$data);

$email->setMessage($body); 
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#7

(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
Reply




Theme © iAndrew 2016 - Forum software by © MyBB