chadxz / imap-simple

Wrapper over node-imap, providing a simpler api for common use cases
MIT License
243 stars 80 forks source link

question about "cleaning" inbox, getting message content HTML body #75

Closed jradom closed 3 years ago

jradom commented 4 years ago

Hello,

I'm very new to Javascript but did use Java to manipulate with emails in the past. So, please help me with some code samples for the following flows:

  1. I want to know if I can only use gmail because our company use gmail but with custom domain
  2. I first want to delete ALL email from Inbox
  3. The I want to get email HTML body of email which my App will generate. So, I want to always deal with one email email in my Inbox Any help will be greatly appreciated

Thanks in advance

Jeff

ghost commented 4 years ago

Did you try the example on the repo front page?

  1. Gmail is SaaS so even with custom domain you will still be connecting to Google imap servers, so shoudn't be a problem even with a custom domain.
  2. You can call .addFlag([uid1, uid2, uid3...], '\Deleted') then close the box to delete mails.
  3. This package will not allow you send email. But there is an example regarding how to get email body.