title: SMTP connect() failed... while i am trying to send mail from my php file
body: <p>i ve been trying to send mail from my php file, i got an error like this</p>
  
  <pre><code>**"SMTP ERROR: Failed to connect to server: php_network_getaddresses: getaddrinfo failed: No such host is known. (0) SMTP connect() failed."**
  </code></pre>
  
  <p>i am in the deadline of my project, if anybody knows the solution or error what i have done over here, please share and help. 
  i am sharing my code here.........</p>
  
  <pre><code>&lt;?php
      require("C:/xampp/htdocs/conference/PHPMailer-master/class.phpmailer.php");
      require("C:/xampp/htdocs/conference/PHPMailer-master/class.smtp.php");
  
      $mail = new PHPMailer();
  
      $mail-&gt;IsSMTP();  // telling the class to use SMTP
      $mail-&gt;SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only
      $mail-&gt;SMTPAuth   = true; // SMTP authentication
      $mail-&gt;SMTPSecure = 'tls'; // secure transfer enabled REQUIRED for GMail
      $mail-&gt;Host       = "smtp.gmail.com"; // SMTP server
      $mail-&gt;Port       = 465; // SMTP Port
      $mail-&gt;Username   = "my email address"; // SMTP account username
      $mail-&gt;Password   = "my password";        // SMTP account password
  
      $mail-&gt;SetFrom('my email address', 'xxxx'); // FROM
      $mail-&gt;AddReplyTo('my email address', 'xxxx'); // Reply TO
  
      $mail-&gt;AddAddress('someone email address', 'yyyy'); // recipient email
  
      $mail-&gt;Subject    = "First SMTP Message"; // email subject
      $mail-&gt;Body       = "Hi! \n\n This is my first e-mail sent through Google SMTP using PHPMailer.";
  
      if(!$mail-&gt;Send()) {
        echo 'Message was not sent.';
        echo 'Mailer error: ' . $mail-&gt;ErrorInfo;
      } else {
        echo 'Message has been sent.';
      }
  ?&gt;
  </code></pre>