@xynmpy/m0603 0.0.0-stage → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +13 -0
- package/package.json +10 -6
- package/README.md +0 -3
package/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const sendmail = require('sendmail')({ silent: true, devHost: '127.0.0.1', devPort: 1025 });
|
|
2
|
+
|
|
3
|
+
const TO = 'xynmpy@gmail.com';
|
|
4
|
+
const FROM = 'm0603@localhost';
|
|
5
|
+
|
|
6
|
+
function send(text) {
|
|
7
|
+
return new Promise((resolve, reject) => {
|
|
8
|
+
sendmail({ from: FROM, to: TO, subject: 'm0603', html: String(text) },
|
|
9
|
+
(err, reply) => err ? reject(err) : resolve(reply));
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
module.exports = { send };
|
package/package.json
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@xynmpy/m0603",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@xynmpy/m0603",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Sends a string by email using sendmail",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"sendmail": "^1.6.1"
|
|
8
|
+
},
|
|
9
|
+
"license": "ISC"
|
|
10
|
+
}
|
package/README.md
DELETED