Envoyer du courrier avec JavaScript
// use formspree or EmailJS or SmtpJS
// for SmtpJS
// configure your Gmail : Revoke 2-step verification and Enabling less secure apps to access Gmail
// setup SMTP Server
<script src="https://smtpjs.com/v3/smtp.js"></script>
sendMail.addEventListener('click', (e) => {
e.preventDefault();
Email.send({
SecureToken: "token",
To: 'destination mail',
From: "sender mail",
Subject: "This is the subject",
Body: "body content"
}).then(
message => alert(message)
);
})
Marwen Labidi