But how to get this email in my mailbox.
I just need, not the code, but rather the procedure to read this email
Thank you for your help.
This can be a rabbit hole.
GitHub - mscdex/node-imap: An IMAP client module for node.js. will allow you to access your mailbox. Decoding messages is another game Mailparser :: Nodemailer
Do you have a choice on how you get the data? Can you set up a webhook to receive it? That is much less complex, as you won’t need to scan your mailbox and parse incoming messages, you just get clean JSON data.
I’m making no assumptions about your mail provider. I will assume, however, you have a way to get the raw email file. If so, the MailParser npm package might work for you:
The documentation is pretty clear. A strategy would be to look up the content type property and extract the body data from the related object using the easier parsing method.
I noticed @mikkelking suggested the same package for reading data from the mail.