This repository contains the implementation of a Zimbra mail client for Node.js.
To install Zimbra mail client, use npm
:
npm install @jagus/zimbra-client
Here is a simple example of how to use the Zimbra mail client:
import { ZimbraClient } from '@jagus/zimbra-client'
const client = new ZimbraClient(
'sender@jagu.cz', // Required, sender address
'superSecretPassword!', // Required, sender password
'mail.jagu.cz' // Optional, default is mail.jagu.cz
)
await client.send({
from: { // Optional, default is sender address
name: "Sender Name",
email: 'sender@jagu.cz'
},
to: 'world@jagu.cz', // Required
subject: 'test', // Required
content: [{
type: 'text/html',
value: "<b>Hello world!</b>"
}],
attachments: [{
filename: "example.md",
content: new Blob([fs.readFileSync('./example.md')])
}]
})