The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Reading Mail in PHP

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

  1. anjanesh

    anjanesh Member

    Joined:
    Oct 4, 2005
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    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
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Try changing this part:

    PHP:
    localhost:110/pop3
    to this:

    PHP:
    localhost:110/pop3/notls
     
  3. anjanesh

    anjanesh Member

    Joined:
    Oct 4, 2005
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    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
    
     
  4. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    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");
     
  5. anjanesh

    anjanesh Member

    Joined:
    Oct 4, 2005
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    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
     
Loading...

Share This Page