title: How to write mail Function using C#?
body: <p>I had created the bootstrap contact form in a website. can anyone help me to write the code for mail function in C#,That yje user fill the form ,when the user clicks submit button,the details must sent to admin's mail.</p>
  
  <p>Here is the code for bootstrap form:</p>
  
  <pre><code>&lt;form class="form form-container"&gt;
              &lt;span class="col-xs-12 col-md-6"&gt;
                      &lt;label for="Name"&gt;Name &lt;span class="red"&gt;*&lt;/span&gt;&lt;/label&gt;
                      &lt;input class="form-control" name="name" type="text" required&gt;
              &lt;/span&gt;
              &lt;span class="col-xs-12 col-md-6"&gt;
                      &lt;label for="Company"&gt;Company&lt;/label&gt;
                      &lt;input class="form-control" name="company" type="text" &gt;
              &lt;/span&gt;
              &lt;span class="col-xs-12 col-md-4"&gt;
                  &lt;br&gt;
                      &lt;label for="Gender"&gt;Gender &lt;span class="red"&gt;*&lt;/span&gt;&lt;/label&gt;
                      &lt;select class="form-control" name="gender" required&gt;
                          &lt;option value=""&gt;Select option&lt;/option&gt;
                          &lt;option value="Male"&gt;Male&lt;/option&gt;
                          &lt;option value="Female"&gt;Female&lt;/option&gt;
                      &lt;/select&gt;
              &lt;/span&gt;
              &lt;span class="col-xs-12 col-md-4"&gt;
                  &lt;br&gt;
                      &lt;label for="Email"&gt;E-Mail &lt;span class="red"&gt;*&lt;/span&gt;&lt;/label&gt;
                      &lt;input type="email" name="email" class="form-control" required&gt;
              &lt;/span&gt;
              &lt;span class="col-xs-12 col-md-4"&gt;
                  &lt;br&gt;
                      &lt;label for="Phone"&gt;Phone &lt;span class="red"&gt;*&lt;/span&gt;&lt;/label&gt;
                      &lt;input type="text" name="phone" class="form-control" required&gt;
              &lt;/span&gt;
              &lt;span class="col-xs-12 col-md-12"&gt;
                  &lt;br&gt;
                      &lt;label for="Subject"&gt;Subject &lt;span class="red"&gt;*&lt;/span&gt;&lt;/label&gt;
                      &lt;input type="text" name="subject" class="form-control" required&gt;
              &lt;/span&gt;
              &lt;span class="col-xs-12 col-md-12"&gt;
                  &lt;br&gt;
                      &lt;label for="Message"&gt;Message &lt;span class="red"&gt;*&lt;/span&gt;&lt;/label&gt;
                      &lt;textarea class="form-control" rows="6" name="message" required&gt;&lt;/textarea&gt;
                  &lt;br&gt;
              &lt;/span&gt;
              &lt;span class="col-xs-12"&gt;
                  &lt;input type="submit" class="btn btn-md btn-success" value="Send message"&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;   
              &lt;/span&gt;
          &lt;/form&gt;
  </code></pre>