您好我想就我的联系表单提供一些帮助,因为我不知道我将在代码中包含哪些电子邮件将作为联系表单中信息的接收者。提前致谢
<center>
<form name='contact-form'>
<div>Name: </div>
<input class='contact-form-name' id='ContactForm1_contact-form-name' name='name' size='30' type='text' value=''/>
<div>Email:</div>
<input class='contact-form-email' id='ContactForm1_contact-form-email' name='email' s ize='30' type='text' value=''/>
答案 0 :(得分:0)
最好的方法是创建一个在提交表单时运行的php脚本!
<form name='contact-form' id="form" method="POST" action="ENTER PHP URL HERE">
<div>Name: </div>
<input class='contact-form-name' id='ContactForm1_contact-form-name' name='name' size='30' type='text' value=''/>
<div>Email:</div>
<input class='contact-form-email' id='ContactForm1_contact-form-email' name='email' size='30' type='text' value=''/>
<div onclick="document.getElementById('form').submit();">SUBMIT</div>
然后你创建一个php脚本来运行你的电子邮件!
php脚本示例:
<?php
$to = "test@someone.com";
$subject = "THIS IS THE SUBJECT LINE";
$message = '<html>
<body>
NAME-------- ' . strip_tags($_POST["name"]) . '<br>
EMAIL ADDRESS-- ' . strip_tags($_POST["email"]) . '<br>
</body>
</html>';
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
$headers .= 'From: from@someone,com' . "\r\n";
mail($to,$subject,$message,$headers);
header("Location: http://successurlgoeshere.com");
?>
我希望这有帮助!