我的联系表格发送4封电子邮件

时间:2014-11-09 17:40:06

标签: c# jquery asp.net

我的asp.net网站上有联系表格。当我们通过表单发送消息时。它发送4封电子邮件,其中3封为空白,1封包含原始信息。我希望它只发送一封包含正确信息的电子邮件 这是联系表单

<%@ Control Language="C#" %>
<div class="styledForm" id="ContactUsForm">
<fieldset class="OneColumn">
<legend>You can also contact us by submitting the below form :</legend>
<div class="FirstRow" onkeypress="return FireDefaultButton(event,SubmitContact);">
        <label>Contact Name<font color="#ff0000">*</font></label>
        <input type="text" class="txtBox" name="ContactName" id="ContactName"  />
    </div>
    <div class="FirstRow" onkeypress="return FireDefaultButton(event,SubmitContact);">
        <label>Contact E-mail<font color="#ff0000">*</font></label>
        <input type="text" class="txtBox" name="ContactEmail" id="ContactEmail"  />
    </div>
    <div class="FirstRow">
        <label style="height:85px">Message<font color="#ff0000">*</font></label>
        <textarea class="txtBox" rows="5" cols="30" name="ContactMessage" id="ContactMessage">   </textarea>
    </div>
    <div class="FirstRow">
        <label>&nbsp;</label>
        <a href="#" class="MaroonButton AllFiveRounded" title="Submit" onclick="return SubmitContact();">Send Message</a>
    </div>
    <div class="clear"></div>
</fieldset>
</div>

这是SubmitCOntact函数

function SubmitContact() {
    ClearValidations();
    $("#ContactName").rules("add", { required: true, messages: { required: "Please enter your Name." } });
    $("#ContactEmail").rules("add", { required: true, email: true, messages: { required: "Please enter your Email Address.", email: "Invalid e-mail address!! Please try user@domain.com." } });
    $("#ContactMessage").rules("add", { required: true, messages: { required: "Please enter your message." } });
    if (FormValidator.form()) {
        SubmitFormInIframe("ContactUsForm", function (data) {
            ShowResult(data, function () {
                $("#ContactUsForm input, #ContactUsForm textarea").val("");
                DisableOverlay();
            }, function () {
                DisableOverlay();
            });
        });
    } else { ShowDialog(Errors, "Error"); }
    return false;
}

0 个答案:

没有答案