Wordpress联系表单收件人问题

时间:2012-09-17 06:14:33

标签: forms wordpress content-management-system sendmail contact

我在这里建立了一个表单:http://22twenty.com/wordpress/contact/

它从标准格式获得传统代码

<form id="contact" method="post" action="<?php bloginfo('template_directory'); ?> contact-send.php" class="validateform">

                    <div id="errormessage"></div>
                    <div id="sendmessage">
                        <p>Your message has been sent. Thank you!</p>
                    </div>  

                        <div class="formfield">
                            <input name="name" type="text"placeholder="Name:" class="text" required/>
                        </div>

                        <div class="formfield">
                            <input name="email" type="email" placeholder="Email:" class="text" required/>
                        </div>

                        <div class="formfield">
                            <input name="subject" type="text" placeholder="Subject:" class="text" required/>
                        </div>

                        <div class="formfield">
                            <textarea name="message" class="text textarea" placeholder="Enter Your Message Here:" required></textarea>
                        </div>

                        <div class="formfield">
                            <input type="submit" id="send" value="Post message"  class="btn" />
                        </div>

                </form>

  <?php $name = $_POST['name'];

$email = $_POST['email'];

$message = $_POST['message'];

$formcontent="From: $name \n Message: $message";

$recipient = "get_option('admin_email')";

$subject = $_POST['subject'];

$mailheader = "From: $email \r\n";

mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");

?>

我想知道两件事情是添加表单的最佳方式,我可以在这种意义上使用get_opition(&#39; admin_email&#39;)吗?

由于

丹佛

1 个答案:

答案 0 :(得分:0)

您可以使用名为contact form 7的插件。您可以轻松自定义总体表格,并提供更多选项和功能,您可以从他们的网站查看文档。希望这会奏效。