title: Linking PHP to HTML failure (using react and jsx)
body: <p>I can't seem to get my PHP file linked to the HTML form successfully.</p>
  <p>Here is my PHP code:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;?php
      require_once('Mail.php');
  
      $name = $_POST['name'];
      $email = $_POST['email'];
      $subject = $_POST['subject'];
      $body = $_POST['body'];
  
      $to='email@gmail.com';
      $headers= array(
          'From' =&gt; $email,
          'To' =&gt; $to,
          'Subject' =&gt; $subject
      );
  
      //smtp settings
      $smtp = Mail::factory('smtp', array(
          'host' =&gt; 'ssl://smtp.gmail.com',
          'port' =&gt; '465',
          'auth' =&gt; true,
          'username' =&gt; 'email@gmail.com',
          'password' =&gt; 'password'
      ));
  
      $mail = $smtp-&gt;send($to, $headers, $body);
  
      if (PEAR::isError($mail)) {
          echo('&lt;p&gt;' . $mail-&gt;getMessage() . '&lt;/p&gt;');
      } else {
          echo('&lt;p&gt;Message successfully sent!&lt;/p&gt;');
      }
  
  ?&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>Here is my HTML form code:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import React from 'react';
  import tiagoImg from '../images/tiagoPhoto.jpg';
  import cell from '../images/cell.jpg';
  import email from '../images/email.jpg';
  import www from '../images/www.jpg';
  import phone from '../images/phone.jpg';
  import address from '../images/address.jpg';
  
  const Contact = () =&gt; {
      return (
          &lt;div className='contactContainer'&gt;
              &lt;center&gt;
                  &lt;h4 class='sent-notification'&gt;&lt;/h4&gt;
                  &lt;form method='post' action='sendEmail.php'&gt;
                      &lt;h2&gt;Send an Email&lt;/h2&gt;
  
                      &lt;label&gt;Name&lt;/label&gt;
                      &lt;input id='name' name='name' type='text' placeholder='Enter name' required/&gt;
                      &lt;br /&gt;
                      &lt;label&gt;Email&lt;/label&gt;
                      &lt;input id='email' name='email' type='text' placeholder='Enter email' required/&gt;
                      &lt;br /&gt;
                      &lt;label&gt;Subject&lt;/label&gt;
                      &lt;input id='subject' name='subject' type='text' placeholder='Enter subject' required/&gt;
                      &lt;br /&gt;
                      &lt;p&gt;Message&lt;/p&gt;
                      &lt;textarea id='body' name='body' rows='S' placeholder='Type message' required&gt;&lt;/textarea&gt;
                      &lt;br /&gt;
                      &lt;input type='submit' name='submit' value='Submit'/&gt;
                  &lt;/form&gt;
              &lt;/center&gt;
          &lt;/div&gt;
      )
  }
  
  export default Contact;</code></pre>
  </div>
  </div>
  </p>
  <p>And this is what my directory looks like:</p>
  <p><a href="https://i.stack.imgur.com/6MNLg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6MNLg.png" alt="enter image description here" /></a></p>
  <p>This is the error I receive when clicking submit:</p>
  <p><a href="https://i.stack.imgur.com/eGJxB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eGJxB.png" alt="enter image description here" /></a></p>