Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/norjs/mailer
Markdown SMTP Email Sending Library
https://github.com/norjs/mailer
Last synced: 25 days ago
JSON representation
Markdown SMTP Email Sending Library
- Host: GitHub
- URL: https://github.com/norjs/mailer
- Owner: norjs
- License: mit
- Created: 2019-12-08T10:41:09.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-01-15T02:06:20.000Z (almost 3 years ago)
- Last Synced: 2023-03-02T08:33:11.141Z (almost 2 years ago)
- Language: JavaScript
- Size: 47.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
@norjs/mailer
=============Asynchronous HTML email sending with Markdown formating.
We are using:
* [nodemailer](https://github.com/andris9/Nodemailer#nodemailer) for actual email sending
* [marked](https://github.com/chjj/marked) for Markdown to HTML conversion
* [lodash](https://lodash.com)### Example Usage
Sends HTML formated email with markdown text alternative.
```javascript
import NrMailer from "@norjs/mailer";async function example () {
const smtp_config = {
"host": "smtp.example.com",
"port": 465,
"secureConnection": true,
"auth": {
"user": "app",
"pass": "12345678"
}
};const mailer = NrMailer.createMailer(smtp_config);
const body = 'The subject of the message\n'+
'--------------------------\n'+
'\n'+
'This is a *sample* email made with Markdown.\n'+
'\n'+
'| Tables | Are | Cool |\n'+
'| ------ | --- | ---- |\n'+
'| col 3 is | right-aligned | $1600 |\n'+
'| col 2 is | centered | $12 |\n'+
'| zebra stripes | are neat | $1 |\n';await mailer.sendMail({
from:'[email protected]',
to:'[email protected]',
subject:'Example message', // This is optional, if not specified, will be "The subject of the message" from the markdown content.
body: body
});await mailer.closeMailer();
console.log('Email sent successfully.');
}
```Commercial Support
------------------You can buy commercial support from [Sendanor](https://norjs.com/).