将动态电子邮件地址添加到发布表单

时间:2019-11-15 14:39:52

标签: php html email post

我有此代码可以发布联系表:

$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);

如何添加field('email')(即在联系人表单的电子邮件输入字段中输入的那个)作为“发送电子邮件至”。有人可以帮我吗?

1 个答案:

答案 0 :(得分:1)

您是说

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