charlierguo / gmail

A Pythonic interface for Google Mail
MIT License
1.77k stars 386 forks source link

email.spam() doesn't work??? #76

Open EmolLi opened 8 years ago

EmolLi commented 8 years ago

email.star() email.read() email.unstar() .. all the other work except email.spam()

AttributeError: Message instance has no attribute 'spam'

adityadhawan22 commented 6 years ago

Add this function in message.py

def spam(self): flag = '\Seen' imap.uid('COPY', self.uid, '[Gmail]/Spam') self.gmail.imap.uid('STORE', self.uid , '+FLAGS', '(\Deleted)') if flag not in self.flags: self.flags.append(flag)