Solved

Problems Changing Flags of POP3 Email with PHP

Posted on 2002-06-27
2
1,094 Views
Last Modified: 2008-03-17
OK...
Per an earlier post I actually ended up figuring out what I was getting in terms on what the current status was on emails.
Now, the next step is to modify the flag/status of the email when several actions are performed:
Read/Opened
Deleted
Responded to
etc..etc..

I have tried map-setflag-full but it hasnt worked..  heres what ive done so far..
$server, $port $mailbox, $user, and $pass are session variables set at login time...

$mbox = @imap_open("{".$server.":".$port."}".$mailbox, $user, $pass) or require_once("login.php");
//!!!  Now inside a function with $mailbox = $mbox and the message number passed as an integer $iMessageNo  {
//Get message code here blah blah

$status = imap_setflag_full ($mailbox, $iMessageNo, "\\Seen", ST_UID)or die(imap_last_error());
print gettype($status)."<br />\n";
print $status."<br />\n";

} //!!!  exit function
//the two print statements return the following:
boolean
1


imap_close($mbox);
///====END read_email.php====
///====back to inbox.php=====
$mbox = @imap_open("{".$server.":".$port."}".$mailbox, $user, $pass) or require_once("login.php");
//draw inbox message headers...  and dernit!!  the flags still arent changed!!

What am I doing wrong?!

0
Comment
Question by:Figment060799
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 40

Expert Comment

by:Richard Quadling
ID: 7116009
Try  ...
imap_setflag_full($mailbox,imap_uid($mailbox,$iMessageNo),"\\SEEN",ST_UID);

Richard.
0
 
LVL 40

Accepted Solution

by:
Richard Quadling earned 200 total points
ID: 7116019
If you try setting the flag, close the mailbox, reopen it and then check. Does the flag only come into view when the mailbox is closed?

The user notes on the PHP manual says that rfc for POP3 says that only the delete flag needs to be supported by POP3. The rest seem to be optional.

You may be finding that your POP3 server does not support these flags!


http://www.php.net/manual/en/function.imap-setflag-full.php

According to the rfc, pop3 does not have support for these flags, except
perhaps for the deleted flag. I haven't tried if the delete flag works on
pop3 or not.



Richard.

0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question