Jump to content

IMAP problem Firewall on?


MrFix

Recommended Posts

Hi folks,

 

I'm trying to receive some mails with the IMAP module in PHP. And it won't work yet.

 

I keep getting the following error:

 

Message: Unknown: Connection failed to 213.51.146.46,21: No route to host (errflg=2)

 

I changed the serveradress (mail.home.nl) in the IP but that only worked for 1 error. This error is not gonna give up ^^.

 

I work with CodeIgniter and I'm using the following class: http://www.phphulp.nl/php/script/overig/cl...p3-reader/1356/ (dutch btw)

But I don't think it has anything to do with the code.

 

Testing Environment:

http://peterwessels.heliohost.org/Unified/...p/imap/connect/

 

The code:

 

Controller

 

<?
   function connect()
       {
       
           $data['username'] = "adres";
           $data['password'] = "wachtwoord";
           $data['server'] = "213.51.146.46";
           $data['port'] = "21";
           $data['mailboxName'] = "inbox";
           
           
           $this->load->model('Imap_model');
           $this->Imap_model->Imapmail($data);
                       
           $connect = $this->Imap_model->connect();
           if($connect == FALSE)
           {
               $this->load->view("failure");
           }
       
       }
?>

 

 

Model:

<?

public function Imapmail($data)
   {
       extract($data);
       
       
       $this->username = $username;
       $this->password = $password;
       $this->server = $server;
       $this->port = $port;
       $this->options = $options;
       $this->mailboxName = $mailboxName;
       return(true);
   }
   public function connect()
   {
       $options = "";
       if(!empty($this->options) && is_array($this->options))
       {
           while(list($key, $option) = each($this->options))
           {
               $options .= "/" . $option;
           }
       }
       
       $adress = '{' . $this->server . ':' . $this->port . $options . '}' . $this->mailboxName;
       $mbox = @imap_open($adress, $this->username, $this->password);
       $this->connection = $mbox;
       if($mbox)
       {
           return true;
       } else
       {
           return false;
       }
   }
?>

 

I hope you can check the firewall, if you can enable me to receive e-mails through imap.

 

With kind regards,

Peter Wessels

Link to comment
Share on other sites

Isn't IMAP usualy port 143? I thought port 21 was usually FTP, but I guess you can use whatever port for whatever you want as long as it's open and both the server and the client both know what protocol they are using to communicate.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...