https://github.com/aneldev/dyna-email-sender
Send emails from nodeJs
https://github.com/aneldev/dyna-email-sender
Last synced: 8 months ago
JSON representation
Send emails from nodeJs
- Host: GitHub
- URL: https://github.com/aneldev/dyna-email-sender
- Owner: aneldev
- License: mit
- Created: 2020-02-04T17:46:40.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-11T23:17:32.000Z (over 3 years ago)
- Last Synced: 2025-02-14T23:41:30.839Z (over 1 year ago)
- Language: JavaScript
- Size: 300 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 22
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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: 'info@my-company.com',
password: 'pass-matters',
allowInvalidCertificates: false,
});
sender.send({
fromTitle: 'Info My Company 👻',
fromAddress: 'info@my-company.com',
toAddress: 'lola@foo.co', // or array of addresses
subject: 'Hello ✔',
text: 'Hello world?',
html: 'Hello world?',
})
.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