Skip to content
Advertisement

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?

Advertisement

Answer

Do you mean

$pp->sendEmailTo($_POST['email']);
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement