Deleting email message using imaplib?

Bill Sneddon bsneddon at yahoo.com
Mon Aug 25 22:40:05 CEST 2003


Mark Roach wrote:

Thanks,
Works for me too.  I did not escape the \.
rookie mistake (:


Bill

> 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