You can use Client-Side validation with Javascript (pure or using some library like JQuery, AngularJS, etc.).
This will occur before you send the data to the server. Something like this:
function Valida() {
if (document.getElementById("nome").value.length < 1) {
alert("Digite um nome.");
document.getElementById("nome").focus();
return false;
} else if (document.getElementById("idade").value.length < 1) {
alert("Digite uma idade.");
document.getElementById("idade").focus();
return false;
} else if (document.getElementById("sexo").value == 0) {
alert("Escolha um sexo.");
document.getElementById("sexo").focus();
return false;
} else {
return true;
}
}
Source: link
You can (and recommend) do the validation also on the server side using NodeJS and Javascript.
The code is great, check out link .
You can send txt or html emails using nodemailer, plugin for express:
var nodemailer = require('nodemailer');
// create reusable transporter object using the default SMTP transport
var transporter = nodemailer.createTransport('smtps://user%40gmail.com:[email protected]');
// setup e-mail data with unicode symbols
var mailOptions = {
from: '"Fred Foo
19.06.2016 / 22:32