abobam0603 1.0.0 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- package/06-02.html +27 -0
- package/{task2.js → 06-02.js} +3 -3
- package/{task3.js → 06-04.js} +2 -3
- package/package.json +4 -5
- package/task1.js +0 -3
- package/task2.html +0 -81
- package/task4.js +0 -17
package/06-02.html
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Send Email</title>
|
5
|
+
</head>
|
6
|
+
<body>
|
7
|
+
<div class="container">
|
8
|
+
<h1>Send Email</h1>
|
9
|
+
<form method="post" action="/send">
|
10
|
+
|
11
|
+
<label for="from">From:</label>
|
12
|
+
<input type="email" id="from" name="from" value="andrei_sml@bk.ru" required><br><br>
|
13
|
+
|
14
|
+
<label for="to">To:</label>
|
15
|
+
<input type="email" id="to" name="to" value="andrei.uiu.uiu@gmail.com" required><br><br>
|
16
|
+
|
17
|
+
<label for="subject">Subject:</label>
|
18
|
+
<input type="text" id="subject" name="subject" value="ururururuurururuuru" required><br><br>
|
19
|
+
|
20
|
+
<label for="message">Message:</label><br>
|
21
|
+
<textarea id="message" name="message" rows="10" value="Aboba Dominatus" cols="30" required></textarea><br><br>
|
22
|
+
|
23
|
+
<button type="submit">Send</button>
|
24
|
+
</div>
|
25
|
+
</form>
|
26
|
+
</body>
|
27
|
+
</html>
|
package/{task2.js → 06-02.js}
RENAMED
@@ -7,7 +7,7 @@ app.use(express.urlencoded({ extended: true }));
|
|
7
7
|
app.use(express.static('public'));
|
8
8
|
|
9
9
|
app.get('/', (req, res) => {
|
10
|
-
res.sendFile(__dirname + '/
|
10
|
+
res.sendFile(__dirname + '/06-02.html');
|
11
11
|
});
|
12
12
|
|
13
13
|
app.post('/send', (req, res) => {
|
@@ -38,6 +38,6 @@ app.post('/send', (req, res) => {
|
|
38
38
|
res.send('Email sent successfully!');
|
39
39
|
}
|
40
40
|
});
|
41
|
-
}).listen(
|
42
|
-
console.log('Server started on port http://localhost:
|
41
|
+
}).listen(5000, () => {
|
42
|
+
console.log('Server started on port http://localhost:5000');
|
43
43
|
});
|
package/{task3.js → 06-04.js}
RENAMED
@@ -1,7 +1,6 @@
|
|
1
|
-
const m0603 = require('
|
1
|
+
const m0603 = require('abobam0603');
|
2
2
|
|
3
3
|
const fromEmail = 'andrei_sml@bk.ru';
|
4
4
|
const toEmail = 'andrei.uiu.uiu@gmail.com';
|
5
5
|
const password = '9QshLJ8vfATV5ZeAj8Na';
|
6
|
-
|
7
|
-
m0603.send(fromEmail, password, toEmail, 'Hello from m0603 module!');
|
6
|
+
m0603.send(fromEmail, password, toEmail, 'gg!');
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "abobam0603",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.3",
|
4
4
|
"description": "m0603 package for sending message through nodemailer",
|
5
5
|
"main": "m0603.js",
|
6
6
|
"scripts": {
|
@@ -10,9 +10,8 @@
|
|
10
10
|
"author": "potatorb",
|
11
11
|
"license": "ISC",
|
12
12
|
"dependencies": {
|
13
|
+
"abobam0603": "^1.0.1",
|
13
14
|
"express": "^4.18.2",
|
14
|
-
"
|
15
|
-
|
16
|
-
},
|
17
|
-
"devDependencies": {}
|
15
|
+
"nodemailer": "^6.9.2"
|
16
|
+
}
|
18
17
|
}
|
package/task1.js
DELETED
package/task2.html
DELETED
@@ -1,81 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>Send Email</title>
|
5
|
-
<style>
|
6
|
-
body {
|
7
|
-
font-family: Arial, sans-serif;
|
8
|
-
font-size: 16px;
|
9
|
-
}
|
10
|
-
|
11
|
-
.container {
|
12
|
-
max-width: 600px;
|
13
|
-
margin: 0 auto;
|
14
|
-
text-align: center;
|
15
|
-
}
|
16
|
-
|
17
|
-
h1 {
|
18
|
-
color: #333;
|
19
|
-
font-size: 28px;
|
20
|
-
}
|
21
|
-
|
22
|
-
form {
|
23
|
-
display: flex;
|
24
|
-
flex-direction: column;
|
25
|
-
}
|
26
|
-
|
27
|
-
label {
|
28
|
-
display: inline-block;
|
29
|
-
width: 100px;
|
30
|
-
text-align: left;
|
31
|
-
}
|
32
|
-
|
33
|
-
input[type="email"], input[type="text"], textarea {
|
34
|
-
width: 100%;
|
35
|
-
padding: 10px;
|
36
|
-
border: 1px solid #ccc;
|
37
|
-
border-radius: 5px;
|
38
|
-
box-sizing: border-box;
|
39
|
-
}
|
40
|
-
|
41
|
-
textarea {
|
42
|
-
height: 100px;
|
43
|
-
}
|
44
|
-
|
45
|
-
button[type="submit"] {
|
46
|
-
background-color: #4CAF50;
|
47
|
-
color: white;
|
48
|
-
padding: 12px 20px;
|
49
|
-
border: none;
|
50
|
-
border-radius: 4px;
|
51
|
-
cursor: pointer;
|
52
|
-
font-size: 16px;
|
53
|
-
}
|
54
|
-
|
55
|
-
button[type="submit"]:hover {
|
56
|
-
background-color: #45a049;
|
57
|
-
}
|
58
|
-
</style>
|
59
|
-
</head>
|
60
|
-
<body>
|
61
|
-
<div class="container">
|
62
|
-
<h1>Send Email</h1>
|
63
|
-
<form method="post" action="/send">
|
64
|
-
|
65
|
-
<label for="from">From:</label>
|
66
|
-
<input type="email" id="from" name="from" value="andrei_sml@bk.ru" required><br><br>
|
67
|
-
|
68
|
-
<label for="to">To:</label>
|
69
|
-
<input type="email" id="to" name="to" value="andrei.uiu.uiu@gmail.com" required><br><br>
|
70
|
-
|
71
|
-
<label for="subject">Subject:</label>
|
72
|
-
<input type="text" id="subject" name="subject" value="ururururuurururuuru" required><br><br>
|
73
|
-
|
74
|
-
<label for="message">Message:</label><br>
|
75
|
-
<textarea id="message" name="message" rows="10" value="Aboba Dominatus" cols="30" required></textarea><br><br>
|
76
|
-
|
77
|
-
<button type="submit">Send</button>
|
78
|
-
</div>
|
79
|
-
</form>
|
80
|
-
</body>
|
81
|
-
</html>
|
package/task4.js
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
// 1. Регаемся на http://npmjs.com
|
2
|
-
// 2. После создания модуля пишем 'npm init' и заполняем данные о пакете
|
3
|
-
// 3. Пишем 'npm login <nickname>' и входим в учетку
|
4
|
-
// 4. Пишем 'npm publish' и вуаля, пакет в npm
|
5
|
-
// 5. npm install
|
6
|
-
// 6. npm uninstall
|
7
|
-
// 7. To install the m0603 package to the global repository, you can run the npm install -g
|
8
|
-
// command in the terminal from the package's root directory. This will install the package globally
|
9
|
-
// and make it available for use in any application.
|
10
|
-
|
11
|
-
const m0603 = require('m0603_adam');
|
12
|
-
|
13
|
-
const fromEmail = 'andrei_sml@bk.ru';
|
14
|
-
const toEmail = 'andrei.uiu.uiu@gmail.com';
|
15
|
-
const password = '9QshLJ8vfATV5ZeAj8Na';
|
16
|
-
|
17
|
-
m0603.send(fromEmail, password, toEmail, 'Hello!');
|