title: SMTP -> ERROR: Failed to connect to server: Connection refused (111)
body: <p>Im building a site and I need to implement a form sending option, after a lot of research I settled on PHPMAILER. I set my script to work with my gmail address for testing purposes and it works fine, but when I inputted the clients email details it doesnt work. </p>
  
  <p>When I submit the application, this is what i am getting</p>
  
  <p><strong>SMTP -> ERROR: Failed to connect to server: Connection refused (111)</strong> </p>
  
  <p>I contacted support and verified the port and host, and contacted the client and verified the login info. Is there another reason why it might not be working?</p>
  
  <p><strong>Update</strong>
   I made a small script that allows me to easily test settings</p>
  
  <pre><code>&lt;?php 
  require 'classes/class.phpmailer.php';
  require 'classes/class.smtp.php';
  
  $mail = new PHPMailer(true); 
  $mail-&gt;IsSMTP(); 
  try{
      $mail-&gt;SMTPDebug  = 1;                     
      $mail-&gt;SMTPAuth   = true;                  
      //$mail-&gt;SMTPSecure = "ssl";no                
      $mail-&gt;Host       = "smtp.domain.com";      
      $mail-&gt;Port       = 25;                  
      $mail-&gt;Username   = "username";//user@domain.com
      $mail-&gt;Password   = "pwd";           
      $mail-&gt;AddAddress('alme1304@gmail.com');//RECIPIENT
      //$mail-&gt;SetFrom('name@yourdomain.com', 'First Last');//IDK WHAT 'THIS' IS FOR
      //$mail-&gt;AddReplyTo($_POST['email'], $_POST['f_name'].' '.$_POST['l_name']);//FOR THE 'REPLY-TO' FIELD
      $mail-&gt;Subject = 'test email';
      $mail-&gt;MsgHTML('test_email');
  
      $mail-&gt;Send();
  } catch (phpmailerException $e) {
      echo $e-&gt;errorMessage(); //Pretty error messages from PHPMailer
      echo $mail-&gt;Host;
      echo '&lt;pre&gt;';
      print_r($mail);
      echo '&lt;/pre&gt;';
  
  } catch (Exception $e) {
      echo $e-&gt;getMessage(); //Boring error messages from anything else!
  }
  </code></pre>