最简单的方法是安装这个插件-https://da.wordpress.org/plugins/contact-form-7/ - 它非常容易使用,并且可以做您想要的事情:)
如果您不想使用插件,那么只需使用html和php编写一个联系人表单。
PHP:
<?php
$firstname = $_POST[\'firstname\'];
$lastname = $_POST[\'lastname\'];
$from = $_POST[\'email\'];
$message = $_POST[\'textarea\'];
$to = "[email protected]";
$subject = "My subject";
$message = "Hello world!";
$headers = "From: " . $email . "\\r\\n" .
"CC: [email protected]";
mail($to,$subject,$message,$headers);
?>
HTML:
<form action="" method="post">
First name:<br>
<input type="text" name="firstname">
<br>
Last name:<br>
<input type="text" name="lastname">
<br>
Email: <br>
<input type="email" name="email">
<br>
Subject:<br>
<input type="text" name="subject">
<br>
Message:<br>
<textarea name="textarea" id="" cols="30" rows="10"></textarea>
<br>
<input type="submit" value="Submit">
</form>