npm.io
10.0.13 • Published 5d ago

@things-factory/email-base

Licence
MIT
Version
10.0.13
Deps
2
Size
51 kB
Vulns
8
Weekly
0

email-base

1. email connection configuration

{app_root}/config.[mode].js

module.exports = {
  email: {
    host: 'smtp.office365.com',
    port: 587,
    secure: false, // true for 465, false for other ports
    auth: {
      user: 'account@emailhost',
      pass: 'password'
    },
    secureConnection: false,
    tls: {
      ciphers: 'SSLv3'
    },
    sender: 'sender-account@emailhost' // if not set, auth.user will be the sender
  }
}

2. send email as virtual user (e.g. noreply@hatiolab.com)

  1. add member into shared mailbox
  2. call sendEmail function with shared mailbox address as sender paramerter
    (e.g. sendEmail({sender: noreply@hatiolab.com}) )