因此,我希望网站发送2封电子邮件 - 发送给员工和客户。工作人员有一个预设的电子邮件,而客户必须在文本框(表格)中写入。我试图得到客户的邮件。PHP:从表单获取电子邮件并在点击按钮时发送它
<form id='contact-info' method='post' novalidate class="form contact-info">
<div class="contact-info__field contact-info__field-mail">
<input type='email' name='user-mail' placeholder='Your email' class="form__mail">
</div>
<div class="contact-info__field contact-info__field-tel">
<input type='tel' name='user-tel' placeholder='Phone number' class="form__mail">
</div>
</form>
</div>
<div class="order">
<a href="Rezervare-final.html" name="button1" class="btn btn-md btn--warning btn--wide">Cumpara</a>
</div>
And here's the php right after the html.
<?php
if (isset($_POST['button1'])) {
$toclient = "Test client";
$tostaff = "Test staff";
$maile = $_POST['user-mail'];
$toclient = wordwrap($toclient, 70);
$tostaff = wordwrap($tostaff, 70);
mail($maile, 'My Subject', $toclient);
mail('[email protected]', 'My Subject', $tostaff);
}
?>
我能够收到工作人员的电子邮件,但不能收到客户的电子邮件。问题:为什么我无法收到客户电子邮件?