Just a simple NodeJS email utility using
- Using npm
npm install ndmail --save
- Using yarn
yarn add ndmail
Constructor for NdMail that have 2 property
imap will be passed to
imap library, and
smtp will be passed to
Connect method is for connecting to imap server and create smtp transport.
This method is for fetching mail from imap. Email will fetched started with uid and filtered by flag.
This method is for sending mail. The options will passed to
nodemailer transport. see at https://nodemailer.com/about/
\Seen to mail with the
\Flagged to mail with the
\Deleted to mail with the
This event will fired when imap connection is error.
This event will fired when mail retrieved from imap is parsed. This will event will fired when new email is received to.
This event will fired when any error on the process.
const NdMail =let ndmail =imap:user: 'firstname.lastname@example.org'password: 'awesomepassword'tls: trueport: 993host: 'imap.gmail.com'inbox: 'INBOX'smtp:host: 'smtp.gmail.com'port: 465secure: true // use SSLauth:user: 'email@example.com'pass: 'awesomepassword'ndmailndmailndmailndmail