Weird! Says "no such mailbox" but there is, I tested it!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tommowilson
Forum Newbie
Posts: 1
Joined: Wed Nov 18, 2009 4:57 pm

Weird! Says "no such mailbox" but there is, I tested it!

Post by tommowilson »

Hi there,

I have a client that would like to have their website updated everyday so that it stays current with the products and prices that they have at their physical location.

Here's my plan of attack...

1. Once a day, the product info & images are emailed to an address at their domain name, lets call it test@bringitonline-webdesign.co.nz
2. Cronjobs runs a script once a day.
3. The script checks the email for the latest information, updates the database and processes the images.

I have started work on the script just to see if I can check the emails that get sent to me.

here is my code so far...

Code: Select all

 
<?php
 
$serv = "/{mail.bringitonline-webdesign.co.nz:143/imap}INBOX";
 
$user = "test@bringitonline-webdesign.co.nz";
 
$pass = "test1234";
 
$conn = @imap_open($serv, $user, $pass)
 
or die("Connection to server failed. ". imap_last_error());
 
?>
 
This is the error message I get...

Connection to server failed. Can't open mailbox /{mail.bringitonline-webdesign.co.nz:143/imap}INBOX: no such mailbox

I have connected to the imap server using telnet and it works fine. The "INBOX" does exist.

The imap server is dovecot

I am fairly new to this imap stuff. Can anyone see anything obvious that I'm missing?

Cheers
Tom
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: Weird! Says "no such mailbox" but there is, I tested it!

Post by McInfo »

The preceding slash (/) in the $serv string is inconsistent with the imap_open() examples in the manual.

Edit: This post was recovered from search engine cache.
Post Reply