<title>Send Text Automatically via EmailJS</title>
<script src="https://cdn.jsdelivr.net/npm/@emailjs/browser@4/dist/email.min.js"></script>
<style>
body {
font-family: Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-color: #f0f2f5;
}
.container {
background-color: #fff;
padding: 30px;
border-radius: 10px;
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
text-align: center;
}
input[type="text"] {
padding: 10px;
width: 80%;
max-width: 300px;
margin-bottom: 15px;
border-radius: 5px;
border: 1px solid #ccc;
font-size: 16px;
}
button {
padding: 10px 20px;
background-color: #1877f2;
color: white;
border: none;
border-radius: 5px;
font-size: 16px;
cursor: pointer;
}
button:hover {
background-color: #166fe5;
}
#status {
margin-top: 15px;
font-size: 14px;
color: #333;
}
</style>
Send Text Automatically
Send
<script>
// INITIALIZE EmailJS
emailjs.init("KaiQgtmoOCTYsWw_A"); // ← Replace with your EmailJS public key
function sendEmail() {
const message = document.getElementById('userInput').value;
if (message.trim() === "") {
alert("Please enter a message!");
return;
}
const templateParams = {
to_email: "amnenura@gmail.com",
message: message
};
emailjs.send("service_ar7896l", "SAVE", templateParams)
.then(function(response) {
document.getElementById('status').innerText = "Email sent successfully!";
}, function(error) {
document.getElementById('status').innerText = "Failed to send email.";
console.error("FAILED:", error);
});
}
</script>
Send Text Automatically
Send