logo
down
shadow

How can I set a message unread?? with delphi 7 and imap from indy10


How can I set a message unread?? with delphi 7 and imap from indy10

By : user2950436
Date : November 17 2020, 11:55 AM
hop of those help? You are trying to pass a UID string where a MsgNum integer is expected. You need to use UIDStoreFlags() instead of StoreFlags():
code :
TheImap.UIDStoreFlags(TheUID, sdReplace, TheFlags - [mfSeen]);


Share : facebook icon twitter icon
IMAP in Php: Marking a message unread/unseen

IMAP in Php: Marking a message unread/unseen


By : user1519672
Date : March 29 2020, 07:55 AM
seems to work fine If I understand this page correctly:
http://www.php.net/manual/en/function.imap-body.php
How to get unread messages and set message read flags over IMAP using Python?

How to get unread messages and set message read flags over IMAP using Python?


By : Dan figgins
Date : March 29 2020, 07:55 AM
this one helps.
code :
import imaplib

def read(username, password, sender_of_interest):
    # Login to INBOX
    imap = imaplib.IMAP4_SSL("imap.gmail.com", 993)
    imap.login(username, password)
    imap.select('INBOX')

    # Use search(), not status()
    status, response = imap.search(None, 'INBOX', '(UNSEEN)')
    unread_msg_nums = response[0].split()

    # Print the count of all unread messages
    print len(unread_msg_nums)

    # Print all unread messages from a certain sender of interest
    status, response = imap.search(None, '(UNSEEN)', '(FROM "%s")' % (sender_of_interest))
    unread_msg_nums = response[0].split()
    da = []
    for e_id in unread_msg_nums:
        _, response = imap.fetch(e_id, '(UID BODY[TEXT])')
        da.append(response[0][1])
    print da

    # Mark them as seen
    for e_id in unread_msg_nums:
        imap.store(e_id, '+FLAGS', '\Seen')
Mark a *single* IMAP message as unread

Mark a *single* IMAP message as unread


By : Tao.Sun
Date : March 29 2020, 07:55 AM
I wish did fix the issue. Well, I feel stupid today.
Apparently the message number being iterated over, and the UID of the message that conn.uid(...) expects are NOT necessarily the same number. I figured out that one has to fetch the UID and do some post-fetch-processing to get just the UID to pass out.
code :
for i in msgnums:
    # ...
    msg_uid = conn.fetch(i, 'UID')[1][0].split()[2].strip('()')
    # ...
import imaplib

class IMAP4(imaplib.IMAP4):
    def search(self, charset, *criteria):
        # conn.uid('SEARCH', charset, criteria)
        return self.uid('SEARCH', charset, " ".join(criteria))


    def fetch(self, message_set, message_parts):
        # conn.uid('FETCH', msgset, parts)
        return self.uid('FETCH', message_set, message_parts)

    def store(self, message_set, command, flags):
        # conn.uid('STORE', msg_uid, '-FLAGS', '(\Seen)')
        return self.uid('STORE', message_set, command, flags)


# noinspection PyPep8Naming
class IMAP4_SSL(imaplib.IMAP4_SSL):
    def search(self, charset, *criteria):
        # conn.uid('SEARCH', charset, criteria)
        return self.uid('SEARCH', charset, " ".join(criteria))

    def fetch(self, message_set, message_parts):
        # conn.uid('FETCH', msgset, parts)
        return self.uid('FETCH', message_set, message_parts)

    def store(self, message_set, command, flags):
        # conn.uid('STORE', msg_uid, '-FLAGS', '(\Seen)')
        return self.uid('STORE', message_set, command, flags)
How to mark unseen last unread message S22.imap

How to mark unseen last unread message S22.imap


By : Lewis Collins
Date : March 29 2020, 07:55 AM
I hope this helps . How read last unread message from mail box and after mark this message "Unseen" , First get uid last unread message:
Applozic : How to show the user first unread message rather than latest unread message?

Applozic : How to show the user first unread message rather than latest unread message?


By : Jappa
Date : March 29 2020, 07:55 AM
like below fixes the issue What you can do is, when you are opening the chat details, you must be having something called, unread count which would indicate the number of messages that haven't been read yet, correct. So you can use this value to scroll your list to that particular message rather than scrolling to bottom.
Related Posts Related Posts :
  • Which is current correct indy and open ssl versions to use with delphi2007
  • Delphi Xe2: WH_KEYBOARD won't return left-right virtual key codes
  • Collecting a list/table of version specific information for RAD Studio/Delphi/C++ Builder related development environmen
  • delphi 2009, interface already released
  • chained proxy in delphi
  • Use VCL Styles From Delphi XE7 to Delphi XE2
  • Rotating an image Delphi XE7
  • Understanding waitable timers
  • Delphi Created Images are not displayed
  • former worked code does not work
  • Formatsettings of client are changing when printing in Firemonkey
  • Why does Delphi XE7 IDE hangs and fails on out of memory exception?
  • How to build delphi projects for WIN64 when units inside it uses DesignEditors DesignIntf?
  • Cannot Destroy Dynamically created Menu Item in Delphi
  • How can I save a TTreeview to Windows and keep its hierarchical structure?
  • Nullable scalar types and LiveBindings
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org