title: PHPMailer "Could not connect to SMTP host."
body: <p>I'm trying to send a mail with PHPMailer (SMTP).<br/>
  btw: the mail server is hosted by switchplus.ch...</p>
  
  <p>But if i try to send a mail, I get the following error: "SMTP Error: Could not connect to SMTP host. 
  "</p>
  
  <p>PHP code to send the mail:</p>
  
  <pre><code>&lt;?php
  require './mail/PHPMailerAutoload.php';
  
  $mail = new PHPMailer;
  
  $mail-&gt;SMTPDebug = 3;                               // Enable verbose debug output
  
  $mail-&gt;isSMTP();                                      // Set mailer to use SMTP
  $mail-&gt;Host = 'smtp.lordsofmahlstrom.li';  // Specify main and backup SMTP servers
  $mail-&gt;SMTPAuth = true;                               // Enable SMTP authentication
  $mail-&gt;Username = 'support@lordsofmahlstrom.li';                 // SMTP username
  $mail-&gt;Password = 'secredPassword';                           // SMTP password
  $mail-&gt;SMTPSecure = 'tsl';                            // Enable TLS encryption, `ssl` also accepted
  $mail-&gt;Port = 587;                                    // TCP port to connect to
  
  $mail-&gt;setFrom('support@lordsofmahlstrom.li', 'Support');
  $mail-&gt;addAddress('test@test.com', 'Tester');     // Add a recipient
  $mail-&gt;addReplyTo('support@lordsofmahlstrom.li', 'Support');
  
  $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';
  }
  ?&gt;
  </code></pre>
  
  <p>Does anyone know, what i did wrong?</p>