<!DOCTYPE html>
Need a contact form that sends automatic email notifications? No backend required!
If you are looking for a simple and easy way to set up a contact form on your website that sends automatic email notifications to a specified email address without the need for a backend server, look no further! With the following HTML code and a little bit of JavaScript, you can create a contact form that will send email notifications to you whenever someone submits a message.
Contact Form
document.getElementById(“contact-form”).addEventListener(“submit”, function(e) {
e.preventDefault();
let name = document.getElementById(“name”).value;
let email = document.getElementById(“email”).value;
let message = document.getElementById(“message”).value;
let emailContent = `Name: ${name}nEmail: ${email}nMessage: ${message}`;
window.open(`mailto:youremail@example.com?subject=Contact Form Submission&body=${emailContent}`);
});
Simply replace “youremail@example.com” with your own email address in the script above, and you’re all set! Now whenever someone submits a message through the contact form, you will receive an email notification with the details of the submission.
This solution is perfect for websites that do not have a backend server or do not have the capability to handle email notifications. It is a quick and easy way to set up a contact form with automatic email notifications.
nah that's good