user3847953
user3847953

Reputation: 47

Add dynamic email address to post form

I have this code to post a contact form:

$pp = new FormHandler(); 

$validator = $pp->getValidator();
$validator->fields(['name','phone'])->areRequired()->maxLength(50);
$validator->field('email')->isEmail();
$validator->field('msg')->maxLength(6000);

$pp->sendEmailTo(''); // ← Your email here

echo $pp->process($_POST);

How can I add the field('email') which is the one entered in the email input field in contact form as the "send email to"..? Can somebody help me please?

Upvotes: 0

Views: 42

Answers (1)

RiggsFolly
RiggsFolly

Reputation: 94682

Do you mean

$pp->sendEmailTo($_POST['email']);

Upvotes: 1

Related Questions