title: Add phpmailer to HTML form
body: <p>I add a phpmailer with SMTP to my site. I have made a phpmailer file, and have done all the necessary coding what was needed. Now I need to know how to correctly add my phpmiler.php to my index.html so I can use my email form. </p>
  
  <p>my phpmailer.php :</p>
  
  <pre><code>&lt;?php
  use PHPMailer\PHPMailer\PHPMailer;
  use PHPMailer\PHPMailer\Exception;
  
  require 'assets/PHPMailer/src/Exception.php';
  require 'assets/PHPMailer/src/PHPMailer.php';
  require 'assets/PHPMailer/src/SMTP.php';
  
  $mail = new PHPMailer(true);                              // Passing `true` enables exceptions
  try {
      //Server settings
      $mail-&gt;SMTPDebug = 0;                                 // Enable verbose debug output
      $mail-&gt;isSMTP();                                      // Set mailer to use SMTP
      $mail-&gt;Host = 'test';  // Specify main and backup SMTP servers
      $mail-&gt;SMTPAuth = true;                               // Enable SMTP authentication
      $mail-&gt;Username = 'test';                 // SMTP username
      $mail-&gt;Password = 'test';                           // SMTP password
      $mail-&gt;SMTPSecure = 'ssl';                           // Enable TLS encryption, `ssl` also accepted
      $mail-&gt;Port = 465;                                    // TCP port to connect to
  
      //Recipients
      $mail-&gt;setFrom('test');
      $mail-&gt;addAddress('test');     // Add a recipient
      $mail-&gt;addReplyTo('test', 'Information');
      $mail-&gt;addCC('cc@example.com');
      $mail-&gt;addBCC('bcc@example.com');
  
  
      //Content
      $mail-&gt;isHTML(true);                                  // Set email format to HTML
      $mail-&gt;Subject = 'Here is the subject';
      $mail-&gt;Body    = 'This is the HTML message body &lt;b&gt;in bold!&lt;/b&gt;';
  
      $mail-&gt;send();
      echo 'Message has been sent';
  } catch (Exception $e) {
      echo 'Message could not be sent.';
      echo 'Mailer Error: ' . $mail-&gt;ErrorInfo;
  }
  ?&gt;
  </code></pre>
  
  <p>I tested the php file, everything works, I use TEST in personal information fields.</p>
  
  <p>My HTML form:</p>
  
  <pre><code>&lt;div class="block"&gt;
      &lt;h2&gt;Send message&lt;/h2&gt;
      &lt;form&gt;
          &lt;div class="form-group"&gt;
              &lt;input type="text" name="mail" class="form-control" placeholder="Email Address"&gt;
          &lt;/div&gt;
          &lt;div class="form-group"&gt;
              &lt;input type="text" name="subject" class="form-control" placeholder="Subject"&gt;
          &lt;/div&gt;
          &lt;div class="form-group"&gt;
              &lt;textarea class="form-control" name="text" rows="3" placeholder="Your Message"&gt;&lt;/textarea&gt;
              &lt;button class="btn btn-default" type="submit" &gt;Send Message&lt;/button&gt;
          &lt;/div&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>How do I make this work so that it takes email, text and subject into my phpmailer.php and send the message throw HTML form?<br>
  Thanks and sorry for my bad language, not my native. </p>