dyna-email-sender
v1.0.4
Published
The dyna-email-sender; Send emails pretty easy.
Downloads
16
Readme
About
Send emails easily! From Node.js
In Typescript.
Example
import {DynaEmailSender} from "dyna-email-sender";
const sender = new DynaEmailSender({
host: 'smtp.ethereal.email',
port: 587,
tls: false,
username: '[email protected]',
password: 'pass-matters',
allowInvalidCertificates: false,
});
sender.send({
fromTitle: 'Info My Company 👻',
fromAddress: '[email protected]',
toAddress: '[email protected]', // or array of addresses
subject: 'Hello ✔',
text: 'Hello world?',
html: '<b>Hello world?</b>',
})
.catch((error: IError) => {
console.log('email send failed', {error});
});
Methods
send(email: IEmail): Promise
interface IEmail {
fromTitle: string;
fromAddress: string;
toAddress: string | string[];
subject: string;
text: string;
html: string;
}
close(): void
Closes any open connection