title: Html Form, when submitted, send straight to email
body: <p>I am using Dreamweaver to create a website, my website has a form, but when I click on the submit button it opens my outlook application, with the information I want. I was just wondering if it was possible to send the email to my account without going through my email client. This is my code...</p>
  
  <p>BTW I am using Dreamweaver to edit all the code.</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html lang="en-US"&gt;
  &lt;head&gt;
  &lt;meta charset="UTF-8"&gt;
  &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt;
  &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
  &lt;title&gt;Fiction Filming&lt;/title&gt;
  &lt;link rel="shortcut icon" href="images/favicon3.ico" type="image/x-icon" /&gt;
  &lt;style type="text/css"&gt;
  body {
      background-color: #2c2c2c;
  }
  &lt;/style&gt;
  &lt;link href="Css/singlePageTemplate.css" rel="stylesheet" type="text/css"&gt;
  &lt;!--The following script tag downloads a font from the Adobe Edge Web Fonts server for use within the web page. We recommend that you do not modify it.--&gt;
  &lt;script&gt;var __adobewebfontsappname__="dreamweaver"&lt;/script&gt;
  &lt;script src="http://use.edgefonts.net/source-sans-pro:n2:default.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --&gt;
  &lt;!-- WARNING: Respond.js doesn't work if you view the page via file:// --&gt;
  &lt;!--[if lt IE 9]&gt;
        &lt;script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"&gt;&lt;/script&gt;
        &lt;script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"&gt;&lt;/script&gt;
      &lt;![endif]--&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;!-- Main Container --&gt;
  &lt;div class="container"&gt; 
    &lt;!-- Navigation --&gt;
    &lt;!-- Hero Section --&gt;
    &lt;!-- About Section --&gt;
    &lt;!-- Stats Gallery Section --&gt;
    &lt;div class="gallery"&gt;&lt;img src="Images/Newbannercomingsoon.png" alt="" width="1000" height="500" class="logo-pic"/&gt; &lt;/div&gt;
    &lt;!-- Parallax Section --&gt;
    &lt;!-- More Info Section --&gt;
    &lt;!-- Footer Section --&gt;
    &lt;section class="footer_banner" id="contact"&gt;
  
  &lt;form class="subscribeForm form-fix" name="Subscription Form" method="post" action="mailform.php" enctype="text/plain"&gt;
              &lt;div class="newform"&gt;
                &lt;div&gt; &lt;/div&gt;
                &lt;div&gt;
                  &lt;input id="fname" type="text" placeholder="NAME" name="name" required&gt;
                &lt;/div&gt;
                &lt;div&gt;
                  &lt;input name="email" type="email" required id="email" placeholder="EMAIL"&gt;
                &lt;/div&gt;
                &lt;div&gt;
                  &lt;select name="select" required id="myselect"&gt;
                    &lt;option&gt;HELP / SUPPORT&lt;/option&gt;
                    &lt;option&gt;BUSINESS ENQUIRES&lt;/option&gt;
                    &lt;option&gt;OTHER&lt;/option&gt;
                  &lt;/select&gt;
                &lt;/div&gt;
                &lt;div class="text-form"&gt;
                  &lt;div&gt;
                    &lt;textarea name="textarea" required id="textarea" placeholder="TYPE YOUR TEXT HERE"&gt;&lt;/textarea&gt;
                  &lt;/div&gt;
                &lt;/div&gt;
                &lt;br&gt;&lt;input name="Send" type="submit" id="Send" value="Send"&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  &lt;!-- Step 1: Add an email field here --&gt;
  
  &lt;!-- Step 2: Add an address field here --&gt;
              &lt;!-- Step 3: add a submit button here --&gt;
  
  &lt;/section&gt;
    &lt;!-- Copyrights Section --&gt;
  &lt;div class="copyright"&gt;&amp;copy;2016 - &lt;strong&gt;Fiction filming&lt;/strong&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;!-- Main Container Ends --&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Also, here is my php file... If you can fix it, it would be really helpful.</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="content-type" content="text/html; charset="UTF-8"&gt;
  &lt;META HTTP-EQUIV="refresh" content="0;URL=thankyou.html"&gt;
  &lt;title&gt;Email Form&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;?php
  if(isset($_POST['submit'])){
      $to = "example@example.com"; // this is your Email address
      $from = $_POST['email']; // this is the sender's Email address
      $sender_name = $_POST['name'];
      $select = $_POST['select'];
      $message = $sender_name . " wrote the following:" . "\n\n" . $_POST['textarea'];
  
      $headers = "From:" . $from;
      $headers2 = "From:" . $to;
      mail($to,$subject,$message,$headers);
      echo "Mail Sent. Thank you " . $name . ", we will contact you shortly.";
      // You can also use header('Location: thank_you.php'); to redirect to another page.
      }
  ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>HERE IS THE NEW PHP</strong></p>
  
  <pre><code>    &lt;!doctype html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="content-type" content="text/html; charset="UTF-8"&gt;
  &lt;META HTTP-EQUIV="refresh" content="3;URL=thankyou.html"&gt;
  &lt;title&gt;Email Form&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;?php
  if(isset($_POST['submit'])){
  
  // Or the below if using "name="Send" for the input. Uncomment and get rid of the above
  // if(isset($_POST['Send'])){
  
  
      if(!empty($_POST['email']) 
      &amp;&amp; !empty($_POST['name']) 
      &amp;&amp; !empty($_POST['select'])
      &amp;&amp; !empty($_POST['textarea'])) {
  
      $to = "mail@fictionfilming.com";
      $from = $_POST['email'];
      $sender_name = $_POST['name'];
      $select = $_POST['select'];
      $textarea = $_POST['textarea'];
  
      $message = $sender_name . " wrote the following:" . "\n\n" . $textarea;
  
      if(mail($to,$subject,$message,$headers)){
      echo "Mail was sent. Check both your inbox and spam, as mail as done its job.";
  }
  else{
      echo "There was a problem. Check your logs.";
  }
  
      }
  
  }
  
     // $headers = "From:" . $from;
     // $headers2 = "From:" . $to;
      //echo "Mail Sent. Thank you " . $name . ", we will contact you shortly.";
      // You can also use header('Location: thank_you.php'); to redirect to another page.
      //}
  ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>