嘿,我想创建一个具有下拉菜单的联系表格,根据您选择的 3 个选项中的哪一个,表格将被发送到不同的电子邮件。我不知道这是否可能,但任何帮助将不胜感激
<form action="process.php" method="post" id="contact_form">
<p class="contact-form-sender">
<input id="name" type="text" placeholder="Name" name="name" />
</p>
<p class="contact-form-email">
<input id="email" type="text" placeholder="Email" name="email" />
</p>
<p class="contact-form-subject">
<input id="subject" type="text" placeholder="Subject" name="subject" />
</p>
<p class="contact-form-content">
<textarea id="message" placeholder="Your enquiries" name="message"></textarea>
</p>
<span class="button-met light"><input id="consubmit" type="submit" name="consubmit" value="Send" /></span>
</form>
<?php
$toemail = 'email@gmail.com';
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$subject = $_POST['subject'];
if(mail($toemail, $subject , $message, 'From: ' . $email)) {
echo 'Your email was sent successfully.';
} else {
echo 'There was a problem sending your email.';
}
?>
是我用于表单的代码