ikmail
v1.0.0
Published
A tiny librairy to send emails with nodejs, using Infomaniak smtp service. Using modules.
Downloads
5
Maintainers
Readme
Ikmail
A tiny librairy to send emails with nodejs, using Infomaniak smtp service.
Using ES6 modules. Not working with require().
Installation
npm install ikmailUsage
import { Mailer } from 'ikmail'
const mailer = new Mailer('[email protected]', 'YourSuperStrongPassword001')
// param1: your email
// param2: your password
mailer.send('[email protected]', '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: callbackCallback
| Argument | Type | Description |
| -------- | ------ | --------------------------------------------------------------------------- |
| res | string | Can be: 'error', 'sended' or 'retry'. |
| data | any | If res is 'error', data is the error. If res is 'sended', data are the informations. If res is 'retry', data is null |
Callback: res
| Value | Description |
| -------- | ------ |
| 'error' | An error occured. |
| 'sended' | Email sended. |
| 'retry' | Email sended but with wrong informations. |
