title: PHPMailer will not work with XAMPP. No Errors. No Emails. Not working?
body: <p>I'm currently using XAMPP and PHPMailer for a simple 'CONTACT ME' email form on my test-website. The problem is as follows. I cannot seem to be able to send out a test email to make sure if it is working. I've spent the majority of my weekend trying to find out the root of this problem but I still cannot seem to find an answer. It does not even tell me if something went wrong or not. </p>
  
  <h3>I've tried the following according to the web/ StackOverFlow/ Documentation:</h3>
  
  <ul>
  <li>removed semicolon from php.ini for line "extension=php_openssl.dll"</li>
  <li>restarted XAMMP</li>
  <li>updated port and host values *seen below*</li>
  <li>DLd PHPMailer from https://github.com/PHPMailer/PHPMailer</li>
  <li>watched PHPAcademy's "<a href="http://youtu.be/FtWD_ZH9lnE" rel="nofollow">Build A PHP Contact Form</a>" Video on Youtube
  <li>Actually 95% of his code is his...just doesn't work for me</li>
  <li>Left a comment on his video. No response as of yet.</li>
  </ul>   
  
  <p>I've looked through most of the questions on this site and came up with nothing that can resolve my problem. I'm reading through quiet a few of documentation and so far. I seem to be doing the right thing. Therefore it baffles me that this simple form is not working for me. </p>
  
  <p>contact.php</p>
  
  <pre><code>&lt;?php
    session_start();
    require_once 'helpers/security.php';
    $errors = isset($_SESSION['errors']) ? $_SESSION['errors'] : [];
    $fields = isset($_SESSION['fields']) ? $_SESSION['fields'] : [];
  
  ?&gt;
  
  &lt;!DOCTYPE html&gt;
  &lt;html lang="eng"&gt;
    &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;title&gt;Contact Form&lt;/title&gt;
      &lt;link rel="stylesheet" href="indexContactStyle.css"&gt;
  
    &lt;/head&gt;
  &lt;body&gt;
    &lt;div class="contact"&gt;
    &lt;?php if( !empty($errors)) :  ?&gt;
      &lt;div class="panel"&gt;  
        &lt;ul&gt;  &lt;li&gt;  &lt;?php echo implode('&lt;/li&gt;&lt;li&gt;', $errors ); ?&gt;  &lt;/li&gt;  &lt;/ul&gt;
      &lt;/div&gt;
    &lt;?php endif ?&gt;
  
    &lt;form action="contact.php" method="post"&gt;
      &lt;label&gt;
        Your Name * &lt;input type="text" name="inputName" autocomplete="off" &lt;?php echo isset($fields['name']) ? ' value= " '. e($fields['name']) .' " ' : '' ?&gt; &gt;
      &lt;/label&gt;
      &lt;label&gt;
        Your Email * &lt;input type="text" name="inputEmail" autocomplete="off" &lt;?php echo isset($fields['email']) ? ' value= " '. e($fields['email']) .' " ' : '' ?&gt; &gt;
      &lt;/label&gt; 
      &lt;label&gt;
        Your Message * &lt;textarea name="message" rows="8"&gt;&lt;?php echo isset($fields['message']) ? e($fields['message']) : '' ?&gt;&lt;/textarea&gt;
      &lt;/label&gt;       
      &lt;input type="submit" value="Send"&gt;
      &lt;p class="muted"&gt; * means a required field&lt;/p&gt;
      &lt;button class="muted" type="button" onClick="goBack()"&gt;Back&lt;/button&gt;
        &lt;/form&gt;
      &lt;/div&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  
  &lt;?php
    unset($_SESSION['errors']);
    unset($_SESSION['fields']);
  ?&gt;
  </code></pre>
  
  <p>index.php</p>
  
  <pre><code>&lt;?php
  
  session_start();
  
  require_once 'libs/phpMailer/PHPMailerAutoload.php';
  
  
  $errors = []; 
  
  print_r($_POST);
  if (isset($_POST['inputName'], $_POST['inputEmail'], $_POST['message'])) {
  
  
  $fields = [
      'name' =&gt; htmlentities( $_POST['inputName'] ),
      'email' =&gt; $_POST['inputEmail'],
      'message'=&gt; $_POST['message']
  
  ];
  
  
  
  foreach ($fields as $field =&gt; $data) {
  
      if( empty($data) ) {
          $errors[] = 'The ' . $field . 'field is required.';
      }
  
  } 
  
  if(empty($errors)) {
      $m = new PHPMailer;
  
      $m-&gt;isSMTP();
      $m-&gt;SMTPauth = true;
      $m-&gt;SMTDebug = true;
      $m-&gt;Host ='smtp.gmail.com';
      $m-&gt;Username = 'myEmail@gmail.com';
      $m-&gt;Password = 'myPass';
      $m-&gt;SMTPSecure = 'ssl';
      $m-&gt;Port = 465;
  
      $m-&gt;isHTML(true);
  
      $m-&gt;Subject = 'Contact form submitted';
  
      $m-&gt;Body ='From: ' .$fields['name'] .  ' ( ' . $fields['email'] . ' ) &lt;p&gt; ' .  $fields['message'] . ' &lt;/p&gt; ' ;
  
      $m-&gt;FromName = 'Contact';
      // Not entirely sure what is supposed to go here. Some ppl put their own email others the email of the sender. which one is it?
      $m-&gt;AddAddress('myEmail@gmail.com', 'myName');
  
      if ( $m-&gt;send() ) {
          header('Location: thanks.php');
          die();
      } else {
          $errors[] = 'Sorry could not send email. Try again later ';
      }
  
  }
  
  
  } else {
  $errors[] = 'Something went HORRIBLY WRONG!!';
  }
  
  
  $_SESSION['errors'] = $errors;
  
  $_SESSION['fields'] = $fields;
  
  header('Location: contact.php');
  </code></pre>