Deleting email message using imaplib?

Mark Roach mrroach at okmaybe.com
Mon Aug 25 16:31:01 EDT 2003


On Mon, 25 Aug 2003 16:14:45 -0400, Bill Sneddon wrote:

> Anyone have an example they are willing to share that shows
> how to use the store command in imaplib?
[...] 
>  >>> m.send('A003 STORE 2:4 +FLAGS (\Deleted)')

here's what I use, works just fine.

    imconn = imaplib.IMAP4(server)
    imconn.login(username, password)
    imconn.select(folder)
    imconn.store(msgid, "+FLAGS", '(\\Deleted)')
    imconn.expunge()


-Mark




More information about the Python-list mailing list