title: Php SMTP Error 10060 : FAILED TO CONNECT TO SERVER
body: <p>I have php code to send email using SMTP connection; It was working perfectly 2 weeks ago. But suddenly stopped working. Don't know what the problem is.</p>
  
  <blockquote>
    <p><strong>SMTP -> ERROR</strong>: FAILED TO CONNECT TO SERVER: A CONNECTION ATTEMPT
    FAILED BECAUSE THE CONNECTED PARTY DID NOT PROPERLY RESPOND AFTER A
    PERIOD OF TIME, OR ESTABLISHED CONNECTION FAILED BECAUSE CONNECTED
    HOST HAS FAILED TO RESPOND. (10060)  SMTP ERROR: COULD NOT CONNECT TO
    SMTP HOST.</p>
  </blockquote>
  
  <pre><code>//start  mailing function
  require_once('PHPMailer_v5.1\class.phpmailer.php');
  $mail  = new PHPMailer();   
  $mail-&gt;IsSMTP();
  //MAIL config
  $mail-&gt;SMTPAuth   = true;
  $mail-&gt;SMTPDebug  = 1;
  $mail-&gt;Host       = "localhost";      // set as the SMTP server
  $mail-&gt;Port       = 25;
  $mail-&gt;Username   = "myemail@web.com";  // localhost email username
  $mail-&gt;Password   = "XXXX";            
  //End mail config
  $mail-&gt;From       = $sender_email;
  $mail-&gt;FromName   = $sender_user_name;
  $mail-&gt;Subject    = $subject;
  $mail-&gt;MsgHTML($body);
  $mail-&gt;AddAddress($to,$to_name);
  $mail-&gt;IsHTML(true); // send as HTML
  if(!$mail-&gt;Send()) {//to see if we return a message or a value bolean
      echo "&lt;p&gt;Confirmation Mail delivery failed due to invalid email specified !&lt;/p&gt;";
  } 
  </code></pre>