如何使用python imaplib访问我的Gmail,然后将它们分类为旅行和非旅行邮件

时间:2017-08-03 05:44:45

标签: python

方法将是 一个。编写访问脚本以获取您的Gmail帐户的权限 湾授予访问权限后,将每封电子邮件和转储旅行相关的电子邮件分类到单独的文件夹中或对其进行适当标记

string planets = "First Mercury Gray"
            + Environment.NewLine
            + "Second Venus Yellow"
            + Environment.NewLine
            + "Third Earth Blue"
            + Environment.NewLine
            + "Fourth Mars Red"
            + Environment.NewLine;

List<string> PlanetOrder = new List<string>();
List<string> PlanetName = new List<string>();
List<string> PlanetColor = new List<string>();
string[] lines = planets.Split(new string[] {Environment.NewLine}, StringSplitOptions.RemoveEmptyEntries);
foreach (string line in lines)
{
    string[] arr = line.Split(' ');
    PlanetOrder.Add(arr[0]);
    PlanetName.Add(arr[1]);
    PlanetColor.Add(arr[2]);
}

我遇到以下错误:

m = imaplib.IMAP4_SSL("imap.gmail.com") 
m.login(user,pwd) 
m.select("cs2043") 
# here you a can choose a mail box like INBOX instead 
#  use m.list() to get all the mailboxes

0 个答案:

没有答案