title: SMTP ERROR: Failed to connect to server: Connection timed out (110) with PHPMailer and Outlook SMTP
body: <p>I am getting SMTP Error with PHP Mailer and Outlook SMTP. I am confused here because it is working fine on localhost with Port number 25 but It is not working on Hosting Server, I have tried all ports with SSL &amp; TLS.<br><Br></p>
  
  <blockquote>
    <p><strong>Error :</strong> SMTP ERROR: Failed to connect to server: Connection timed out (110)</p>
  </blockquote>
  
  <p><br><Br>
  <strong>My Code:</strong></p>
  
  <pre><code>&lt;?php
  
  include("PHPMailer.php"); 
  
  error_reporting(E_ALL);
  ini_set('display_errors', '1');
  
  $mail = new PHPMailer();
  $mail-&gt;IsSMTP();
  $mail-&gt;Host = "smtp.live.com";
  $mail-&gt;SMTPDebug = 2;
  $mail-&gt;Port = 587;
  $mail-&gt;SMTPAuth = true;
  $mail-&gt;SMTPSecure = "ssl";
  $mail-&gt;Username = "info@neelcomputech.com";
  $mail-&gt;Password = "password";
  $mail-&gt;Priority    = 1;
  $mail-&gt;CharSet     = 'UTF-8';
  $mail-&gt;ContentType = 'text/html; charset=utf-8\r\n';
  
  $mail-&gt;From = "info@neelcomputech.com";
  $mail-&gt;FromName = $name;
  $mail-&gt;AddAddress("info@neelcomputech.com");
  
  $mail-&gt;IsHTML(true);
  
  $mail-&gt;Subject = "You got Message from Website";
  $mail-&gt;Body = "testing";
  
  if(!$mail-&gt;Send())
  {
      echo 'Mailer Error: ' . $mail-&gt;ErrorInfo;
  }
  else
  {
      echo 'success';
  }
  
  ?&gt;
  </code></pre>
  
  <p><br>
  Please help me to solve this issue. I have Shared Linux Hosting.</p>