imap_open error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • James Turnbull

    imap_open error

    I am having troubles with some imap_open()

    I am using the following code:

    <?php

    $mbox = imap_open ("{mailserver:9 93/imap/ssl/no-validatecert}IN BOX", "user",
    "password") ;

    echo "<p><h1>Mailbox es</h1>\n";
    $folders = imap_listmailbo x ($mbox,
    "{mailserver:99 3/imap/ssl/novalidate-cert}", "*");

    if ($folders == false) {
    echo "Call failed<br>\n";
    } else {
    while (list ($key, $val) = each ($folders)) {
    echo $val."<br>\n";
    }
    }

    echo "<p><h1>Hea ders in INBOX</h1>\n";
    $headers = imap_headers ($mbox);

    if ($headers == false) {
    echo "Call failed<br>\n";
    } else {
    while (list ($key,$val) = each ($headers)) {
    echo $val."<br>\n";
    }
    }

    imap_close($mbo x);

    ?>

    I get the following error:

    Notice: (null)(): Can't open mailbox
    {mailserver:993/imap/ssl/no-validatecert}IN BOX: invalid remote specification
    (errflg=2) in Unknown on line 0

    I am using PHP 4.3.1 under Windows XP with Apache 2.0.46. I have enabled
    the imap and openssl extensions in php.ini.

    Anyone know what the problem is? I have done some googling and RTFM but I
    can't see where I am going wrong.

    Thanks in advance

    James Turnbull


  • James Turnbull

    #2
    Re: imap_open error

    Jon Kraft wrote:[color=blue]
    > "James Turnbull" <james@lovedtha nlost.net> wrote:
    >[color=green]
    >> I am having troubles with some imap_open()
    >>
    >> $mbox = imap_open ("{mailserver:9 93/imap/ssl/no-validatecert}IN BOX",
    >>
    >> Notice: (null)(): Can't open mailbox
    >> {mailserver:993/imap/ssl/no-validatecert}IN BOX: invalid remote
    >> specification (errflg=2) in Unknown on line 0[/color]
    >
    > Hi James,
    >
    > It has to be "novalidate-cert", not "no-validatecert".
    >
    > JOn[/color]

    Tried that. Still same error message.

    Regards

    James Turnbull


    Comment

    • Jon Kraft

      #3
      Re: imap_open error

      "James Turnbull" <james@lovedtha nlost.net> wrote:
      [color=blue]
      > Jon Kraft wrote:[color=green]
      >> "James Turnbull" <james@lovedtha nlost.net> wrote:
      >>[color=darkred]
      >>> I am having troubles with some imap_open()
      >>>
      >>> $mbox = imap_open ("{mailserver:9 93/imap/ssl/no-validatecert}IN BOX",
      >>>
      >>> Notice: (null)(): Can't open mailbox
      >>> {mailserver:993/imap/ssl/no-validatecert}IN BOX: invalid remote
      >>> specification (errflg=2) in Unknown on line 0[/color]
      >>
      >> It has to be "novalidate-cert", not "no-validatecert".[/color]
      >
      > Tried that. Still same error message.[/color]

      $mbox = imap_open ("{mailserver:9 93/imap/ssl/novalidate-cert}INBOX",
      "user", "password") ;

      You obviously replaced username and password here.
      But what about mailserver? Is that a replacement for a server name or IP?
      - Make sure it is correct and up and running.
      - Try telnetting to it on port 993.
      - Check username & password

      JOn

      Comment

      Working...