title: Sudden PHP Error "Warning: imap_open() [function.imap-open]: Couldn't open stream"
body: <p>Okay, this code 'was' working perfectly and then I started playing around with it in order to let others connect to their e-mails and as you do ran into a few open stream errors along the way due to various typos and such.</p>
  
  <p>Since doing this, all of a sudden I can't connect to my e-mail at all? A short while back I was using the exact same connection code and then browsing my inbox.</p>
  
  <p>I always get the "Warning: imap_open() [function.imap-open]: Couldn't open stream" error.</p>
  
  <p>This is strange as I'm using the exact same code as before, but since bumping into errors I can't connect whatsoever now. It also takes ages to respond.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>$mailbox = imap_open('{mail.artisancodesmith.com:143/notls}INBOX', 'admin@artisancodesmith.com', 'PASSWORD');
  
  if ($mailbox) {
      $response = "MAIL MENU:&lt;br&gt;
          inbox: View your inbox.&lt;br&gt;
          compose: Compose an e-mail.&lt;br&gt;
          setup: Set your e-mail account's settings.";
      $next = "iorcmail";
  }
  </code></pre>
  
  <p>NOTE: The PHP page is connecting to the e-mail on the same server.</p>
  
  <p><em><strong>UPDATE:</em>
  If I replace "mail.artisancodesmith.com" with "localhost" it works again!
  I would preferably like to use my actual IMAP host - I'll see if it works again some time in the future I guess.
  Thanks to all who helped. :)</strong></p>