Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Reading Mail in PHP

Discussion in 'E-mail Discussion' started by anjanesh, Feb 3, 2006.

  1. anjanesh

    anjanesh Member

    Joined:
    Oct 4, 2005
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    151
    Location:
    Trivandrum, Kerala, India
    I cant seem to get to connect to my mail account in PHP.
    The email account was created in Cpanel X 1.0 (RC36)

    PHP:
    $mbox imap_open ("{localhost:110/pop3}INBOX""user@domain.com""password") or die(imap_last_error());
    imap_close ($mbox);
    This is the output I get
    Code:
    Warning: imap_open(): Couldn't open stream {localhost:110/pop3}INBOX in /home/webhost1/public_html/folder/imap.php on line 6
    POP3 connection broken in response
    Notice: (null)(): POP3 connection broken in response (errflg=1) in Unknown on line 0
    
    Any idea how to get this work ?

    Thanks
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,460
    Likes Received:
    21
    Trophy Points:
    463
    Location:
    Go on, have a guess
    Try changing this part:

    PHP:
    localhost:110/pop3
    to this:

    PHP:
    localhost:110/pop3/notls
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. anjanesh

    anjanesh Member

    Joined:
    Oct 4, 2005
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    151
    Location:
    Trivandrum, Kerala, India
    I tried in 3 ways - all 3 returned errors.
    Code:
    $mbox = imap_open("{localhost:110/pop3/notls}INBOX", "user+domain.com", "pass");
    Warning: imap_open(): Couldn't open stream {localhost:110/pop3/notls}INBOX in /home/webhost1/public_html/folder/imap.php on line 7
    
    Code:
    $mbox = imap_open("{localhost:110/pop3/notls}INBOX", "user@domain.com", "pass");
    Warning: imap_open(): Couldn't open stream {localhost:110/pop3/notls}INBOX in /home/webhost1/public_html/folder/imap.php on line 7
    
    Code:
    $mbox = imap_open("{localhost:110/pop3/notls}INBOX", "user", "pass");
    Warning: imap_open(): Couldn't open stream {localhost:110/pop3/notls}INBOX in /home/webhost1/public_html/folder/imap.php on line 7
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    166
    Have you tried:

    Code:
    $mbox = imap_open("{yourdomain.com:110/pop3}INBOX", "user", "pass");
    or
    Code:
    $mbox = imap_open("{mail.yourdomain.com:110/pop3}INBOX", "user", "pass");
    or
    Code:
    $mbox = imap_open("{yourIP:110/pop3}INBOX", "user", "pass");
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. anjanesh

    anjanesh Member

    Joined:
    Oct 4, 2005
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    151
    Location:
    Trivandrum, Kerala, India
    Thanks webignition - yours worked - but I dont understand why need to specify domain / IP when running on localhost ? How come localhost is not working ?

    Thanks
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice