npm i @acymailing/sending-service
import {AcyMailer} from '@acymailing/sending-service';
const mailer = new AcyMailer('your-license-key');
const domain = await mailer.addDomain({name: 'example.com'});
const email = {
to: 'email@recipients.com',
subject: 'test email from node lib',
body: '<h1>Hello</h1>, this is a test email from the node lib', // altBody?: string,
fromEmail: 'email@example.com',
fromName: 'Email example',
replyToEmail: 'no-reply@example.com',
replyToName: 'Email no-reply',
bounceEmail: 'bounce@example.com', // cc?: string[];
attachments: [
'/paht/to/attachment.png'
]
};
const response = await mailer.sendEmail(email);
Install the dependencies:
npm install
Build and test:
npm run test