1.0.0 • Published 6 months ago

ikmail v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

Ikmail

A tiny librairy to send emails with nodejs, using Infomaniak smtp service.

Using ES6 modules. Not working with require().

Installation

npm install ikmail

Usage

import { Mailer } from 'ikmail'

const mailer = new Mailer('your@domainname.com', 'YourSuperStrongPassword001')
// param1: your email
// param2: your password

mailer.send('the@recipient.com', 'Name', 'Test', '<p>Test</p>', (res, data) => {
  console.log(res, data)
})
// param1: recipient email
// param2: your display name
// param3: email subject
// param4: email content ( html )
// param5: callback

Callback

ArgumentTypeDescription
resstringCan be: 'error', 'sended' or 'retry'.
dataanyIf res is 'error', data is the error. If res is 'sended', data are the informations. If res is 'retry', data is null

Callback: res

ValueDescription
'error'An error occured.
'sended'Email sended.
'retry'Email sended but with wrong informations.

License

MIT

1.0.0

6 months ago