-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample.html
More file actions
40 lines (32 loc) · 900 Bytes
/
Copy pathsample.html
File metadata and controls
40 lines (32 loc) · 900 Bytes
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
<!DOCTYPE html>
<html>
<head>
<title>Send Mail</title>
<script src="https://smtpjs.com/v3/smtp.js"></script>
<script type="text/javascript">
function sendEmail(usermail) {
var maild =document.getElementById("mailId").value;
console.log(maild);
document.getElementById("mailId").value="";
Email.send({
Host: "smtp.gmail.com",
Username: "vineethsharma119@gmail.com",
Password: "Sharma@007",
To: maild,
From: "vineethsharma119@gmail.com",
Subject: "Sending Email using javascript",
Body: "Well that was easy!!"
}).then(
alert("mail sent successfully")
);
}
</script>
</head>
<body>
<form method="post">
<input type="text" name="mail" id="mailId" required />
<input type="button" value="Send Email"
onclick="sendEmail()" />
</form>
</body>
</html>