Spent ages trying to get this to work, then eventually remembered I had opened the mailbox READONLY - obviously you need write permission for setting flags!(PHP 4, PHP 5, PHP 7, PHP 8)
imap_setflag_full — İletileri imler
   Belirtilen aralık içindeki iletilerin imlerine
   belirtilen im imini ekler.
  
imapIMAP\Connection nesnesi.
aralıkİleti numaraları aralığı. İmlenecek iletileri X,Y biçeminde sıralayabilir veya X:Y biçeminde bir aralık olarak belirtebilirsiniz.
im
       » RFC 2060 tarafından
       tanımlanmış şu imler belirtilebilir: \Seen
       (okundu), \Answered (yanıtlandı),
       \Flagged (imlendi), \Deleted
       (silindi) ve \Draft (taslak).
      
seçeneklerŞu seçeneklerden sadece birini içerebilir:
ST_UID - aralık
          bağımsız değişkeni sıra numaraları yerine eşsiz kimlikleri içerir.
         
        
   Daima true döndürür.
  
   seçenekler geçersiz ise
   ValueError oluşur.
  
| Sürüm: | Açıklama | 
|---|---|
| 8.0.0 | 
       seçenekler geçersiz ise artık
       ValueError oluşuyor.
       Evvelce, bir uyarı verilir ve işlev false döndürürdü.
       | 
     
| 8.1.0 | 
  imap bağımsız değişkeni artık
  IMAP\Connection nesnesi kabul ediyor, evvelce
  resource türünde geçerli bir imap değeri
  kabul ederdi.
  | 
Örnek 1 - imap_setflag_full() örneği
<?php
$pk = imap_open("{imap.example.org:143}", "birey", "parola")
     or die("bağlanılamadı: " . imap_last_error());
$durum = imap_setflag_full($pk, "2,5", "\\Seen \\Flagged");
echo gettype($durum) . "\n";
echo $durum . "\n";
imap_close($pk);
?>Spent ages trying to get this to work, then eventually remembered I had opened the mailbox READONLY - obviously you need write permission for setting flags!Where possible I would avoid using POP3 accounts. My host allowed me to upgrade to IMAP and it is so much easier. I think the only way to accurately create any form of mail client with POP3 is to download the messages into an SQL database which is a big task to start with, considering the IMAP standards have the functionality we need built in.
I experimented with flag setting in POP3 and it seems they do not stick at all, and it is almost impossible to retrieve the number of unread messages (ie. the Seen / Unseen thing does not work)
Converted to IMAP and it's working - the majority of the functions in this section seem to be IMAP focussed and WILL NOT generally work with POP3