Web Analytics Made Easy -
StatCounter IMAP/POP3 and message_id/UID - CodingForum

Announcement

Collapse
No announcement yet.

IMAP/POP3 and message_id/UID

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • IMAP/POP3 and message_id/UID

    Hi,
    I have the following script that connects to a POP3 account and gets the header of the first message on the server, however when I try to get the body I get an error complaining that the message number is invalid, I am using the messages UID rather than the message number, but I've got the UID flag in there so what’s wrong?

    PHP Code:
    <?php

        $connection 
    imap_open('{***:110/pop3}INBOX''***''***');
        
    $message imap_headerinfo($connection1);
        
    $body imap_body($connection$message->message_idFT_UID);
        echo 
    $body;

    ?>
    Although in this example I could quite safely use the message number, what if I downloaded this list of messages, and then the e-mails on the sever changed and I tried to delete a message based on the message number, it could delete the wrong one, which is why I want to use UID, the message number seems pretty useless to be honest.

    Edit:

    Ok, so ive discovered that $message->message_id is not the UID, however the imap_uid() function does not work for POP3, so is there an alternative, or is the php POP3 support actually useless?
    Last edited by Jak-S; Oct 4, 2006, 07:13 AM.
Working...
X