Welcome Guest, Not a member yet? Register   Sign In
How to organize Code igniter 4 mail with multi-input post
#1

Hi gentle guys, I have stuck on Codeigniter 4.7 mult-input varis like
Code:
<input name="one">
<input name="two">
<input name="three">


I want to know which is the best way to organize mutl input in message body like:

PHP Code:
$email = \Config\Services::email();

$email->setFrom('[email protected]''Your Name');
$email->setTo('[email protected]');
$email->setCC('[email protected]');
$email->setBCC('[email protected]');

$email->setSubject('Email Test');
$email->setMessage('
  /* Here I want mult-input posting variables HTML/TEXT PLAIN*/
    $this->request->getVar('
one');
   $this->request->getVar('
two');
   $this->request->getVar('
three');/*and so on ---------*/



.'
);

$email->send(); 

Thank
Codeigniter First, Codeigniter Then You!!
yekrinaDigitals

Reply
#2

I don't get what you don't know exactly.
Like this?
PHP Code:
$email->setMessage(
    $this->request->getVar('one')
    . $this->request->getVar('two')
    $this->request->getVar('three')
); 
Reply
#3

(This post was last modified: 01-25-2022, 01:02 AM by luckmoshy.)

(01-24-2022, 10:36 PM)kenjis Wrote: I don't get what you don't know exactly.
Like this?
PHP Code:
$email->setMessage(
    $this->request->getVar('one')
    . $this->request->getVar('two')
    $this->request->getVar('three')
); 

I have a mail form with multi- input as follow:
Code:
<form>
     <input name="var1">
<input name="var2">
<input name="var3">
<input name="var4">
<input name="var5">
<input name="var6">
<input name="var7">
<input name="var8">
</form>

I want thise inputs to work on a post to mail as I asked above thank you whether HTML/TEXT
Codeigniter First, Codeigniter Then You!!
yekrinaDigitals

Reply




Theme © iAndrew 2016 - Forum software by © MyBB