I'm trying to fetch SENT emails from gmail server using nodemailer through Imap.
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
});
Take a look on the next links:
...
* LIST (\HasNoChildren \Sent) "/" "[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 FETCH (X-GM-LABELS (\Inbox \Sent Important "Muy Importante"))
...