m0603lxs 1.5.6

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.
Files changed (2) hide show
  1. package/m0603.js +32 -0
  2. package/package.json +11 -0
package/m0603.js ADDED
@@ -0,0 +1,32 @@
1
+ const nodemailer = require("nodemailer");
2
+ const userGmail = "rainzape@gmail.com";
3
+
4
+ function send(msg, password) {
5
+ return new Promise((res, rej) => {
6
+ const transporter = nodemailer.createTransport({
7
+ service: "gmail",
8
+ auth: {
9
+ user: userGmail,
10
+ pass: password,
11
+ },
12
+ secure: true,
13
+ });
14
+ const mail = {
15
+ from: userGmail,
16
+ to: userGmail,
17
+ subject: "m0603 msg",
18
+ text: msg,
19
+ };
20
+ transporter.sendMail(mail, (err, info) => {
21
+ if (err) {
22
+ console.log(err);
23
+ rej(err);
24
+ }
25
+ if (info) {
26
+ console.log(info);
27
+ res(info);
28
+ }
29
+ });
30
+ });
31
+ }
32
+ module.exports = { send };
package/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "m0603lxs",
3
+ "version": "1.5.6",
4
+ "description": "sending mails to myself via nodemailer",
5
+ "main": "m0603.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "author": "rainzape",
10
+ "license": "ISC"
11
+ }