title: Mailer Error: The following From address failed: Called Mail() without being connected
body: <p>I am using <code>PHPMailer</code> using <code>SMTP</code> to send Email. I have set everything.<br><Br>
  But in the last I am getting error :<br> <code>Mailer Error: The following From address failed: Email Address : Called Mail() without being connected</code>
  <br><br>I came to know to set Order of coding, I also did it but still same error. Please help me to solve this issue.
  <br><br>
  <strong>My Code :</strong></p>
  
  <pre><code>&lt;?php
  
  require 'PHPMailer.php';
  
  error_reporting(E_ALL);
  ini_set('display_errors', '1');
  
  $name = $_POST["name"];
  $email = $_POST["email"];
  $subject = $_POST["subject"];
  $message = $_POST["message"];
  
  $mail = new PHPMailer();
  $mail-&gt;IsSMTP();
  $mail-&gt;Host = "smtp.live.com";
  $mail-&gt;Port = 587;
  $mail-&gt;SMTPAuth = true;
  $mail-&gt;Username = "example@outlook.com";
  $mail-&gt;Password = "password";
  $mail-&gt;SMTPSecure = 'tls';
  
  $mail-&gt;From = "info@neelcomputech.com";
  $mail-&gt;FromName = $name;
  $mail-&gt;AddAddress("info@neelcomputech.com");
  
  $mail-&gt;IsHTML(true);
  
  $mail-&gt;Subject = $subject;
  
  $mail-&gt;Body = $mail_body = "&lt;html&gt; &lt;body&gt;";
  $mail_body = "&lt;b&gt;Hello Admin,&lt;/b&gt;&lt;br&gt;&lt;br&gt;You have got email from your website.&lt;br&gt;&lt;br&gt;";
  $mail_body .= '&lt;table style="" cellpadding="3"&gt;';
  $mail_body .= "
                  &lt;tr&gt;
                  &lt;td width='50'&gt; &lt;strong&gt; Name &lt;/strong&gt; &lt;/td&gt;
                  &lt;td width='5'&gt; : &lt;/td&gt;
                  &lt;td&gt; $name &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                  &lt;td&gt; &lt;strong&gt; Email &lt;/strong&gt; &lt;/td&gt;
                  &lt;td&gt; : &lt;/td&gt;
                  &lt;td&gt; $email &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                  &lt;td&gt; &lt;strong&gt; Message &lt;/strong&gt; &lt;/td&gt;
                  &lt;td&gt; : &lt;/td&gt;
                  &lt;td&gt; $message &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;/table&gt;
                  &lt;/body&gt; &lt;/html&gt;"; 
  
  if(!$mail-&gt;Send())
  {
      echo 'Mailer Error: ' . $mail-&gt;ErrorInfo;
  }
  else
  {
      echo 'success';
  }
  
  ?&gt;
  </code></pre>