IMAP create new mailbox problem

the mail() function

Moderators: macek, egami, gesf

chump2877
New php-forum User
New php-forum User
Posts: 44
Joined: Mon Nov 08, 2004 10:42 am
Contact:

IMAP create new mailbox problem

Postby chump2877 » Sat Nov 12, 2005 6:42 pm

This code doesn;t create a new mailbox, and I dont know why:


Code: Select all

$ServerName = "{xxx.xxx.x.xx:110/pop3}";

        $mbox = imap_open($ServerName, $username,$password) or die("Could not open Mailbox.");
         
        // Create Mailbox
         
        $name3 = $ServerName . "INBOX.sent";
         
        if (!imap_createmailbox($mbox, $name3))
        {
            echo "Unable to create new mailbox!\n\r";
            die();
        }



The x's in $ServerName are the IP address....

I've isolated the problem to the execution of this function:


Code: Select all

imap_createmailbox($mbox, $name3)



The function is returning FALSE (when it shouldn't be), and thus the error is displayed:


Unable to create new mailbox!



No PHP or IMAP error occurs.

I can;t see an error in the code, as it is straight from php.net...I can only guess that maybe there is a server/PHP/IMAP configuration problem here that is preventing this code from being parsed correctly...

Please, if anyone has an idea of what could be wrong, please comment here....I've spent hours upon hours researching this problem with no results....I would appreciate ANY input you might have here...thanks

User avatar
gesf
Moderator
Moderator
Posts: 1717
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden
Contact:

Postby gesf » Mon Nov 28, 2005 5:52 pm

1. Please tell us what platform you're running under (windows/linux) ?
2. Make sure IMAP support is configured correctly. See it with your phpinfo().

The port number part of the mailbox parameter is optional.
Also we're not working with POP3 or SMTP protocols, so you should use imap instead of pop3.
Try changing the next portion of code:

Code: Select all

<?php

// This:
$ServerName = "{xxx.xxx.x.xx:110/pop3}";

// To this:
$ServerName = "{xxx.xxx.x.xx/imap}";

// Or:
$ServerName = "{xxx.xxx.x.xx:110/imap}";

?>


Return to “PHP coding => Mail”

Who is online

Users browsing this forum: No registered users and 1 guest

cron