-
Notifications
You must be signed in to change notification settings - Fork 0
/
send.html
58 lines (52 loc) · 2.13 KB
/
send.html
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
52
53
54
55
56
57
58
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="style.css" rel="stylesheet" type="text/css" media="all">
<title>send me a message</title>
<script src="https://cdn.emailjs.com/dist/email.min.js"></script>
<script src="https://hcaptcha.com/1/api.js" async defer></script>
<script>
(function(){
emailjs.init("cBNzAwZunI-sqz1Ng");
})();
function sendMail(e) {
e.preventDefault(); // Prevent default form submission
if (typeof hcaptcha !== 'undefined') {
const response = hcaptcha.getResponse();
if (response.length === 0) {
alert("please complete the hcaptcha.");
return false;
}
} else {
alert("hcaptcha is not loaded properly. contact dev");
return false;
}
emailjs.sendForm('service_khnxrpa', 'template_ro64laf', '#emailForm')
.then(function(response) {
alert('email sent successfully!');
})
.catch(function(error) {
alert('failed to send email. error: ' + JSON.stringify(error));
});
}
</script>
</head>
<body>
<h2>send me some messages</h2>
<h4>pls don't abuse this</h4>
<form id="emailForm" onsubmit="sendMail(event)">
<label for="subject">your name:</label><br>
<input type="text" id="from_name" name="from_name" required><br><br>
<label for="subject">subject:</label><br>
<input type="text" id="subject" name="subject" required><br><br>
<label for="subject">your email:</label><br>
<input type="text" id="reply_to" name="reply_to" required><br><br>
<label for="message">message:</label><br>
<textarea id="message" name="message" rows="10" cols="30" required></textarea><br><br>
<div class="h-captcha" data-sitekey="3cbe28e8-d648-4372-b182-a6586f206864"></div>
<input type="submit" value="send!!!">
</form>
</body>
</html>