I'm a new bee in programming and find a solution for fetch mail messages with Attachments from Gmail but I'm having an issue with Attachment retrieving some time it works fine but sometimes it struck any solution for this?
I have also need some information about this Attachment Retrieve function that's getPartData() what exactly props this function needs.
I know it will be "message" and "part" but message object contain lots of information that need to retrieve Attachment?
I'm a new bee in programming and find a solution for fetch mail messages with Attachments from Gmail but I'm having an issue with Attachment retrieving some time it works fine but sometimes it struck any solution for this?
I have also need some information about this Attachment Retrieve function that's getPartData() what exactly props this function needs. I know it will be "message" and "part" but message object contain lots of information that need to retrieve Attachment?
let config = { imap: { user: "your@gmail.com", password: "yourpassword", host: "imap.gmail.com", port: 993, tls: true, authTimeout: 3000, }, };
try { await imaps.connect(config).then(async (connection) => { await connection .openBox("INBOX") .then(async () => { try { // Fetch emails from the last 3h var delay = 3 3600 1000; var fetchFrom = new Date(); fetchFrom.setTime(Date.now() - delay); fetchFrom = fetchFrom.toISOString(); var searchCriteria = [["SINCE", fetchFrom]];
}); } catch (e) { console.log("Imap Connect", e.Error ? e.Error : e.message, e); }