如何在ASP.NET C#中发送电子邮件联系我们表单

时间:2016-02-29 05:11:12

标签: c# asp.net forms email mailto

由于我已经构建了表单,现在我希望将信息直接发送到我的邮件收件箱,但是当客户端点击发送mailto选项来自默认邮件端时,如何在客户端填写时直接在我的电子邮件中收到邮件联系我们表格,代码如下,页面链接为contact us link       

        <form class="well form-horizontal"  action="" method="post" id="contact_form">
    <fieldset>

    <!-- Form Name -->
    <legend class="ContactUsHeading">Contact Us !</legend>

    <!-- Text input-->

    <div class="form-group">
      <label class="col-md-4 control-label">First Name</label>  
      <div class="col-md-4 inputGroupContainer">
      <div class="input-group">
      <span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
      <input  name="first_name" placeholder="First Name" class="form-control"  type="text">
        </div>
      </div>
    </div>

    <!-- Text input-->

    <div class="form-group">
      <label class="col-md-4 control-label" >Last Name</label> 
        <div class="col-md-4 inputGroupContainer">
        <div class="input-group">
      <span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
      <input name="last_name" placeholder="Last Name" class="form-control"  type="text">
        </div>
      </div>
    </div>

    <!-- Text input-->
           <div class="form-group">
      <label class="col-md-4 control-label">E-Mail</label>  
        <div class="col-md-4 inputGroupContainer">
        <div class="input-group">
            <span class="input-group-addon"><i class="glyphicon glyphicon-envelope"></i></span>
      <input name="email" placeholder="E-Mail Address" class="form-control"  type="text">
        </div>
      </div>
    </div>


    <!-- Text input-->

    <div class="form-group">
      <label class="col-md-4 control-label">Phone #</label>  
        <div class="col-md-4 inputGroupContainer">
        <div class="input-group">
            <span class="input-group-addon"><i class="glyphicon glyphicon-earphone"></i></span>
      <input name="phone" placeholder="(845)555-1212" class="form-control" type="text">
        </div>
      </div>
    </div>

    <!-- Text input-->



    <!-- Text input-->



    <!-- Select Basic -->


    <!-- Text input-->



    <!-- Text input-->


    <!-- radio checks -->
     <div class="form-group">
                            <label class="col-md-4 control-label">Your</label>
                            <div class="col-md-4">
                                <div class="radio">
                                    <label>
                                        <input type="radio" name="Company" value="yes" /> Company
                                    </label>
                                </div>
                                <div class="radio">
                                    <label>
                                        <input type="radio" name="company" value="no" /> Individual
                                    </label>
                                </div>
                            </div>
                        </div>

    <!-- Text area -->

    <div class="form-group">
      <label class="col-md-4 control-label">Project Description</label>
        <div class="col-md-4 inputGroupContainer">
        <div class="input-group">
            <span class="input-group-addon"><i class="glyphicon glyphicon-pencil"></i></span>
                <textarea class="form-control" name="comment" placeholder="Project Description"></textarea>
      </div>
      </div>
    </div>

    <!-- Success message -->
    <div class="alert alert-success" role="alert" id="success_message">Success <i class="glyphicon glyphicon-thumbs-up"></i> Thanks for contacting us, we will get back to you shortly.</div>

    <!-- Button -->
    <div class="form-group">
      <label class="col-md-4 control-label"></label>
      <div class="col-md-4">
        <button type="submit" class="btn btn-primary" >Send <span class="glyphicon glyphicon-send"></span></button>
      </div>
    </div>

    </fieldset>
    </form>
    </div>
        <!-- /.container -->

0 个答案:

没有答案