0

Is there a similar way, I can access emails from a Kloxo server just like how we can access Gmail through imap?

The thing is, I am testing my code which means it requires multiple number of email accounts. I do not want to spam Gmail with dummy accounts, but instead I have kloxo installed in my VPS that I can just use to create email accounts.

Now the problem with using the code I use to access Gmail tru imap doesn't work in my kloxo.

Here are the settings of my kloxo, the SMTP port is @ 587, webmail.xxx.com and mail.xxx.com points to my VPS ipaddress.

here is the code I am using to access my email:

      function readMail() {

   $dns = "{mail.xxxx.com:587}INBOX";
   $email = "xxx@xxxx.com";
   $password = "xxxx";

   $openmail = imap_open($dns,$email,$password ) or die("Cannot Connect ".imap_last_error());
   if ($openmail) {
         echo  "You have ".imap_num_msg($openmail). " messages in your inbox\n\r";
         for($i=1; $i <= 100; $i++) {
          $header = imap_header($openmail,$i);
          echo "<br>";
          echo $header->Subject." (".$header->Date.")";
          }

       echo "\n\r";
       $msg = imap_fetchbody($openmail,1,"","FT_PEEK");
     echo $msg;
     imap_close($openmail);
      }else {

      echo "False";

      }

  }
    readMail();

Is it only my setting in my code? or also have to tweak something in my kloxo? But I already tried sending an email tru my Kloxo email using localhost file (PHPmailer), and it works. Somebody can help me?

arvil
  • 840
  • 11
  • 27
  • SMTP won't help you connect to IMAP. They are two completely different protocols. IMAPS usually runs on port 993. – Max Apr 18 '14 at 15:57
  • @Max So what should I do? use 993 as port? Should I look for another approach? Just anything to real my goal: read my inbox using PHP. – arvil Apr 18 '14 at 18:04

0 Answers0