This is a discussion on imap_open error within the PHP Language forums, part of the PHP Programming Forums category; I am having troubles with some imap_open() I am using the following code: <?php $mbox = imap_open ("{mailserver:993/...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I am having troubles with some imap_open()
I am using the following code: <?php $mbox = imap_open ("{mailserver:993/imap/ssl/no-validatecert}INBOX", "user", "password"); echo "<p><h1>Mailboxes</h1>\n"; $folders = imap_listmailbox ($mbox, "{mailserver:993/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>Headers 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($mbox); ?> I get the following error: Notice: (null)(): Can't open mailbox {mailserver:993/imap/ssl/no-validatecert}INBOX: 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 |
|
|||
|
Jon Kraft wrote:
> "James Turnbull" <james@lovedthanlost.net> wrote: > >> I am having troubles with some imap_open() >> >> $mbox = imap_open ("{mailserver:993/imap/ssl/no-validatecert}INBOX", >> >> Notice: (null)(): Can't open mailbox >> {mailserver:993/imap/ssl/no-validatecert}INBOX: invalid remote >> specification (errflg=2) in Unknown on line 0 > > Hi James, > > It has to be "novalidate-cert", not "no-validatecert". > > JOn Tried that. Still same error message. Regards James Turnbull |
|
|||
|
"James Turnbull" <james@lovedthanlost.net> wrote:
> Jon Kraft wrote: >> "James Turnbull" <james@lovedthanlost.net> wrote: >> >>> I am having troubles with some imap_open() >>> >>> $mbox = imap_open ("{mailserver:993/imap/ssl/no-validatecert}INBOX", >>> >>> Notice: (null)(): Can't open mailbox >>> {mailserver:993/imap/ssl/no-validatecert}INBOX: invalid remote >>> specification (errflg=2) in Unknown on line 0 >> >> It has to be "novalidate-cert", not "no-validatecert". > > Tried that. Still same error message. $mbox = imap_open ("{mailserver:993/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 |