我能理解一些标签,我也成功地编辑了一个名为 GetSimple 的 CMS,并且一切正常(几个月前)。现在,几个月后,我已经开始使用这个并且无法通过......
我收到了发送成功的消息……“感谢您与我们联系。我们会尽快与您联系。”但我没有收到邮件。我从互联网上尝试了不同的 HTML 和 PHP 示例,但这是同样的问题。
HTML
<form method="POST" action="send.php" class="left" enctype="text/plain">
<input type="hidden" name="form-name" value="contact" />
<fieldset>
<label for="your_name">YOUR NAME *</label><input type="text" id="your_name" name="your_name" class="required" /><br/>
<label for="your_email">YOUR email *</label><input type="text" id="your_email" name="your_email" class="required email" /><br/>
<label for="current_site">current site</label><input type="text" id="current_site" name="current_site" /><br/>
<label for="estimated_budget">estimated budget</label><input type="text" id="estimated_budget" name="estimated_budget" /><br/>
<label for="project_description">project description</label> <textarea id="project_description" name="project_description"></textarea><br/>
<!--<input type="submit" value="send" id="sendbutton"> -->
<button class="defaultButton small" id="quotebutton"><span class="buttonLabel">Send</span></button>
</fieldset>
</form>
PHP 命名为“send.php”
<?php
if(isset($_POST['email'])) {
$email_to = "mymail@gmail.com";
$email_subject = "example subject";
$your_name = $_POST['your_name']; // required
$your_email = $_POST['your_email']; // required
$error_message = "Please enter valid e-mail adress";
$email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
}
$email_message = "Form details below.\n\n";
function clean_string($string) {
$bad = array("content-type","bcc:","to:","cc:","href");
return str_replace($bad,"",$string);
}
$email_message .= "Name: ".clean_string($your_name)."\n";
$email_message .= "Mail: ".clean_string($your_email)."\n";
$email_message .= "Current site: ".clean_string($current_site)."\n";
$email_message .= "Estimated budget: ".clean_string($estimated_budget)."\n";
$email_message .= "Project description: ".clean_string($project_description)."\n";
// create email headers
$headers = 'From: '.$your_email."\r\n".
'Reply-To: '.$your_email."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers);
?>
}
<!-- place your own success html below -->
Thank you for contacting us. We will be in touch with you very soon.
<?php
die();
?>