Sending an eMail, when a form is submitted
<p>I am using Dreamweaver to create a simple coming soon website. However when I click the submit button on my form, it just opens my default mail application and asks me to send the email. I then made a php that is meant to send the email. If anyone could look at it, I would be greatly appreciated. If you fix the php, could you give me the whole version, I am not very good at this stuff and don't understand most of it.</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"&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><strong>And Here is the 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'])){
    $to = "nicholas@fictionfilming.com";
    $from = $_POST['email'];
    $sender_name = $_POST['name'];
    $subject = $_POST['select'];
    $textarea = $_POST['textarea'];
    $body = $sender_name . " wrote the following:" . "\n\n" . $textarea;
    $subject = $subject;
    mail($to,$subject,$body);

    if(mail($to,$subject,$body)){
    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>