-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontact.js
More file actions
51 lines (44 loc) · 1.5 KB
/
Copy pathcontact.js
File metadata and controls
51 lines (44 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// /* SMTP Email */
// const form = document.getElementById('contact-form');
// function emailSend() {
// // debugger;
// Email.send({
// SecureToken: "005cf327-4b4c-4a98-8dae-ccb2a0db00cd",
// Secure: true,
// Host: "smtp.elasticemail.com",
// Port: 2525,
// Username: "marwa.mohamed8712000@gmail.com",
// Password: "8BEB72CC47A7E9D03BD12B4C5CD232E0B23E",
// To: 'marwa.mohamed8712000@gmail.com',
// From: "marwa.mohamed8712000@gmail.com",
// Subject: "This is the subject",
// Body: "Name:" + document.getElementById('username').value +
// "<br><br>Email:" + document.getElementById('useremail').value +
// "<br><br>Subject:" + document.getElementById('usersub').value +
// "<br><br>Message:" + document.getElementById('usermsg').value
// })
// }
// form.addEventListener('submit', (e) => {
// e.preventDefault();
// });
function emailSend() {
fetch("http://18.209.58.223:3000/sendEmail", {
method: "POST",
body: JSON.stringify({
"name": document.getElementById('username').value,
"email": document.getElementById('useremail').value,
"subject": document.getElementById('usersub').value,
"message": document.getElementById('usermsg').value,
}),
headers: {
"Content-type": "application/json",
}
})
.then(response => {
console.log(response);
})
.catch((err) => {
console.log(err);
});
console.log("hello")
}