使用nodejs从gmail imap获取发送的电子邮件 [英] fetch sent emails from gmail imap using nodejs

查看:480
本文介绍了使用nodejs从gmail imap获取发送的电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过Imap使用nodemailer从gmail服务器中获取SENT电子邮件.

I'm trying to fetch SENT emails from gmail server using nodemailer through Imap.

以下解决方案不起作用,结果是INBOX未发送

the solution below is not working and the result is the INBOX not SENT

var imap = new Imap({
        user: request.body.email,
        password: request.body.password,
        host: '{imap.gmail.com:993/imap/ssl}INBOX.Sent',
        port: 993,
        tlsOptions: { rejectUnauthorized: false },
        tls: true
    });

推荐答案

看看下面的链接:

  1. LIST命令的特殊扩展名

...
* LIST (\HasNoChildren \Sent) "/" "[Gmail]/Sent Mail"
...

如您所见,[Gmail]/Sent Mail就是您所需要的.

As you can see [Gmail]/Sent Mail is all what you need.

记住,如果您的界面语言与英语不同,标签名称将会更改.

Remember, the label name will be changed if your interface language is different to english.

  1. 以下是有关如何访问Gmail的示例标签:X-GM-LABELS

...
* 1 FETCH (X-GM-LABELS (\Inbox \Sent Important "Muy Importante"))
...

这篇关于使用nodejs从gmail imap获取发送的电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆