我正在尝试在php中弹出联系表单。弹出窗体工作正常。但我想要发件人和收件人收到的邮件。在我的表格中,收件人收到邮件,而发件人没有收到邮件。你能帮我解决一下代码中的错误吗?这是代码
<form id='contactus' action='javascript:fg_submit_form()' method='post' accept-charset='UTF-8'>
<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 class='short_explanation'>* required fields</div>
<div id='fg_server_errors' class='error'></div>
<div class='container'>
<label for='name' >Your Full Name*: </label><br/>
<input type='text' name='name' id='name' value='' maxlength="50" /><br/>
<span id='contactus_name_errorloc' class='error'></span>
</div>
<div class='container'>
<label for='email' >Email Address*:</label><br/>
<input type='text' name='email' id='email' value='' 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="10" cols="50" name='message' id='message'></textarea>
</div>
<?php
require_once("./include/fgcontactform.php");
require_once("./include/captcha-creator.php");
$formproc = new FGContactForm();
$captcha = new FGCaptchaCreator('scaptcha');
$formproc->EnableCaptcha($captcha);
//1.Add your email address here.
//You can add more than one receipients.
$formproc->AddRecipient('abc@gmail.com'). $email;
$formproc->SetFormRandomKey('dz0sbNoc7mZPgXa');
if(isset($_POST['submitted']))
{
if($formproc->ProcessForm())
{
echo "success";
}
else
{
echo $formproc->GetErrorMessage();
}
}
?>
答案 0 :(得分:0)
$formproc->AddRecipient('abc@gmail.com'). $email;
这条线看起来真的很值得怀疑。你想在这做什么如果您要发送给两个用户,则需要拨打两次AddRecipient
方法
答案 1 :(得分:0)
试试这个:
$formproc->AddRecipient('senderEmail@gmail.com, receiverEmail@gmail.com');