如何使弹出式联系表单发送电子邮件

时间:2019-01-03 08:26:28

标签: email-forwarding

除了没有发送电子邮件(或者至少没有到达指定的目的地)之外,我的弹出式联系人的工作方式还不错。

我已经按照下载(http://form.guide/contact-form/simple-php-contact-form.html)附带的所有说明进行操作,并且检查了其他存在类似问题的线程。我不知道还能尝试什么。抱歉,如果我在下面添加了太多代码,但是我不知道问题出在哪里。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"       
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Suggestions & feedback</title>   
</head>
<body>

<style>
#popup-form {
    display: none;
    position: absolute;
    color: white;
    background-color: #4E90EE;
    width: 400px;


}

</style>


 <a id="popup-clickie" href="feedback"><img src="feedbackbutton.png"  
 width="200" height="30" ></a>

 <div id="popup-form">

<?PHP

http://www.html-form-guide.com/contact-form/simple-php-contact-form.html

require_once("./include/fgcontactform.php");
require_once("./include/simple-captcha.php");

$formproc = new FGContactForm();
$sim_captcha = new FGSimpleCaptcha('scaptcha');

$formproc->EnableCaptcha($sim_captcha);


$formproc->AddRecipient ('info@fredures.org'); 



$formproc->SetFormRandomKey('CnRrspl1FyEylUj');


if(isset($_POST['submitted']))
{
if($formproc->ProcessForm())
{
    $formproc->RedirectToURL("http://fredures.org/thankyou");
}
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"    
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
<head>
  <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>

  <link rel="STYLESHEET" type="text/css" href="contact.css" />
  <script type='text/javascript' src='scripts/gen_validatorv31.js'>   
</script>
</head>
<body>

<!-- Form Code Start -->
<form id='contactus' action='<?php echo $formproc->GetSelfScript(); ?>' 
method='post' accept-charset='UTF-8'>
<fieldset >


<input type='hidden' name='submitted' id='submitted' value='1'/>
<input type='hidden' name='<?php echo $formproc->GetFormIDInputName();  
?>' value='<?php echo $formproc->GetFormIDInputValue(); ?>'/>
<input type='text'  class='spmhidip' name='<?php echo   
$formproc->GetSpamTrapInputName(); ?>' />



<div><span class='error'><?php echo $formproc->GetErrorMessage();   
?></span></div>
<div class='container'>
<label for='name' >Name: </label>
<input type='text' name='name' id='name' value='<?php echo   
$formproc->SafeDisplay('name') ?>' maxlength="50" /><br/>
<span id='contactus_name_errorloc' class='error'></span>
</div>
<div class='container'>
<label for='email' >Email:&#8202;</label>
<input type='text' name='email' id='email' value='<?php echo   
$formproc->SafeDisplay('email') ?>' maxlength="50" /><br/>
<span id='contactus_email_errorloc' class='error'></span>
</div>
<div class='container'>
<label for='message' >Message:</label><br/>
<span id='contactus_message_errorloc' class='error'></span>
<textarea rows="15" cols="50" name='message' id='message'><?php echo 
$formproc->SafeDisplay('message') ?></textarea>
</div>
<fieldset id='antispam'>

<div class='container'>
<label for='scaptcha' ><?php echo $sim_captcha->GetSimpleCaptcha();  
?></label>
<input type='text' name='scaptcha' id='scaptcha' maxlength="10" /><br/>
<span id='contactus_scaptcha_errorloc' class='error'></span>
</div>
</fieldset>

<div class='container'>
<input type='submit' name='Submit' value='Submit' />
</div>

</fieldset>
</form>
<!-- client-side Form Validations:
Uses the excellent form validation script from JavaScript-coder.com-->

<script type='text/javascript'>


var frmvalidator  = new Validator("contactus");
frmvalidator.EnableOnPageErrorDisplay();
frmvalidator.EnableMsgsTogether();
frmvalidator.addValidation("name","req","Please provide your name");

frmvalidator.addValidation("email","req","Please provide your email   
address");

frmvalidator.addValidation("email","email","Please provide a valid email 
address");

frmvalidator.addValidation("message","maxlen=2048","The message is too 
long!(more than 2KB!)");


frmvalidator.addValidation("scaptcha","req","Please answer the anti-spam 
question");


</script>


</body>
</html>

<script>
var showPopup = function(event) {
    event.preventDefault();
    document
        .getElementById('popup-form')
        .style.display = 'block';
};

document
    .getElementById('popup-clickie')
    .addEventListener('click', showPopup);


  $(function() {
$('#click-show').on('click', function(event) {
$('#pop-up').toggle();
event.stopPropagation();
});

$(document).on('click', function(event) {
if(event.target.id !== "pop-up" && event.target !== document){
   $('#pop-up').hide();
}
});

});


</script>

0 个答案:

没有答案