Gmail Api - 获取附件

时间:2017-12-04 10:26:05

标签: gmail attachment gmail-api email-attachments

是否可以获取所有特定邮件的附件? 我只找到GET AttachmentById

1 个答案:

答案 0 :(得分:0)

首先,您会获得来自特定标记的消息列表

            var re = service.Users.Messages.List("me");
            re.LabelIds = "Label_2";
            re.Q = "is:unread";
            var res = re.Execute();

然后你通过id

获得消息
               foreach (var email in res.Messages)
                {
                   GetAttachments(service, "me", email.Id, credPath);

                 }
相关问题