擅长:python、mysql、java
<p>它会将给定gmail标签中的所有邮件移动到gmail垃圾箱中</p>
<pre><code>#!usr/bin/python
import email, imaplib
user = 'xxx'
pwd = 'xxx'
m = imaplib.IMAP4_SSL("imap.gmail.com")
m.login(user,pwd)
m.select("some_gmail_label")
m.store("1:*",'+X-GM-LABELS', '\\Trash')
m.expunge() # should be useless, but gmail server says it is ok
</code></pre>
<p>记住刷新你的gmail界面,因为它有缓存</p>