首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用mail-listener2获取仅带有附件的收件箱?

如何使用mail-listener2获取仅带有附件的收件箱?
EN

Stack Overflow用户
提问于 2017-10-03 12:36:02
回答 1查看 551关注 0票数 0

我对邮件听众很陌生。我能够获取gmail收件箱和附件,但我的要求是只取收件箱。与附件一起使用邮件侦听器:

代码语言:javascript
复制
var mailListener = new MailListener({
    username: "xxxx@gmail.com",
    password: "xxx",
    host: "imap.gmail.com",
    port: 993, // imap port
    tls: true,
    //ssl:true,
    connTimeout: 10000, // Default by node-imap
    authTimeout: 5000, // Default by node-imap,
    debug: console.log, // Or your custom function with only one   incoming argument. Default: null
    tlsOptions: { rejectUnauthorized: false },
    mailbox: "INBOX", // mailbox to monitor
    //searchFilter: ["UNSEEN", "FLAGGED"], // the search filter being used after an IDLE notification has been retrieved
    markSeen: true, // all fetched email willbe marked as seen and not fetched next time
    fetchUnreadOnStart: true, // use it only if you want to get all unread email on lib start. Default is `false`,
    mailParserOptions: {streamAttachments: true}, // options to be passed to mailParser lib.
    attachments: true, // download attachments as they are encountered to the project directory
    attachmentOptions: { directory: "attachments/" } // specify a   download directory for attachments
});

相反,邮箱:“收件箱”,我想要类似于邮箱:“仅收件箱附件”或搜索过滤器:“有附件”之类的内容。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-10-03 13:19:19

我不认为使用邮件列表2是个好主意。在我看来,使用这些第三方库从来都不是件好事,因为您将不得不处理许多其他问题。谷歌提供Gmail,您可以使用它访问收件箱,获取推送通知等。请在这里阅读https://developers.google.com/gmail/api

顺便说一下你的密码是公开的。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46544756

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档