title: SMTP connect() failed error in PHPMailer
body: <p>I am completely new to PHP and I want to send a mail using PHP. I have a Contact Us form whcih will accept email is of the person contacting me and therefore the mail will be sent to me. I am using PHPMailer library from <a href="https://github.com/PHPMailer/PHPMailer/tree/master" rel="noreferrer">https://github.com/PHPMailer/PHPMailer/tree/master</a> and following is the code snippet I am using.</p>
  
  <pre><code>&lt;?php
  require("class.phpmailer.php");
  $mail = new PHPMailer();
  $mail-&gt;IsSMTP();  
  
  $mail-&gt;SMTPSecure = 'tls';
  
  $mail-&gt;Host     = "resolver1.opendns.com"; // this SMTP server of my machine
  //$mail-&gt;Host     = "208.67.222.222";//ip ; which one to use the resolver1.opendns.com or 208.67.222.222 ???
  
  $mail-&gt;From     = "xyz@gamil.com;//email id of the person 
  
  $mail-&gt;AddAddress("datta.dhonde@coreathena.com");//my email id
  
  $mail-&gt;Subject  = "First PHPMailer Message";
  $mail-&gt;Body     = "Hi! \n\n This is my first e-mail sent through PHPMailer.";
  $mail-&gt;WordWrap = 50;
  
  if(!$mail-&gt;Send()) 
  {
    echo 'Message was not sent.';
    echo 'Mailer error: ' . $mail-&gt;ErrorInfo;
  }  
  else 
  {
    echo 'Message has been sent.';
  }
  ?&gt; 
  </code></pre>
  
  <p>I am getting the error " Message was not sent.Mailer error: SMTP connect() failed."
  I am not getting what is the problem..?
  $mail->Host = "";        please comment on what this stands for?? </p>