title: PHP Mailer error: Message could not be sent.Mailer Error: SMTP connect() failed
body: <p>Here is my code:</p>
  
  <pre><code>require 'phpmailertesting/PHPMailerAutoload.php';
  
  $mail = new PHPMailer;
  
  //$mail-&gt;SMTPDebug = 3;                               // Enable verbose debug output
  
  $mail-&gt;isSMTP();                                      // Set mailer to use SMTP
  $mail-&gt;Host = 'send.one.com';  // Specify main and backup SMTP servers
  $mail-&gt;SMTPAuth = true;                               // Enable SMTP authentication
  $mail-&gt;Username = 'myemailhidden';                 // SMTP username
  $mail-&gt;Password = 'mypasswordhidden';                           // SMTP password
  $mail-&gt;SMTPSecure = 'ssl';                            // Enable TLS encryption, `ssl` also     accepted
  $mail-&gt;Port = 465;                                    // TCP port to connect to
  
  $mail-&gt;From = 'myemailhidden';
  $mail-&gt;FromName = 'My Name';
  $mail-&gt;addAddress('example@example.com');               // Name is optional
  
  $mail-&gt;addCC('cc@example.com');
  $mail-&gt;addBCC('bcc@example.com');
  
  //$mail-&gt;addAttachment('/var/tmp/file.tar.gz');         // Add attachments
  //$mail-&gt;addAttachment('/tmp/image.jpg', 'new.jpg');    // Optional name
  $mail-&gt;isHTML(true);                                  // Set email format to HTML
  
  $mail-&gt;Subject = 'Here is the subject';
  $mail-&gt;Body    = 'This is the HTML message body &lt;b&gt;in bold!&lt;/b&gt;';
  $mail-&gt;AltBody = 'This is the body in plain text for non-HTML mail clients';
  
  if(!$mail-&gt;send()) {
  echo 'Message could not be sent.';
  echo 'Mailer Error: ' . $mail-&gt;ErrorInfo;
  } else {
      echo 'Message has been sent';
  }
  </code></pre>
  
  <p>I have tried changing the port and the type of secure connection to "TSL" and "SSL" and nothing. Ive looked at the answers already and none of them solve it. Any answers? Thanks</p>
  
  <p>I enabled the SMTP debugger and this is what it said "Connection: opening to ssl://send.one.com:465, t=300, opt=array ( ) 2014-12-15 15:46:40   SMTP ERROR: Failed to connect to server: Connection timed out (110) 2014-12-15 15:46:40 SMTP connect() failed"</p>