<label>Nombre</label>
<input type="text" name="nombre"/>
<label>Apellido</label>
<input type="text" name="apellido"/>
<label>Celular</label>
<input type="text" name="celular"/>
<label>Correo</label>
<input type="text" name="correo"/>
<label>Mensaje</label>
<textarea row="2" name="mensaje" ></textarea>
<button type="button" onclick="">Enviar</button>
Asked
Active
Viewed 72 times
1

gen_Eric
- 223,194
- 41
- 299
- 337

Cecilia4585
- 29
- 4
-
1https://stackoverflow.com/questions/7381150/how-to-send-an-email-from-javascript || https://www.emailjs.com/ – bZezzz Nov 09 '21 at 20:04
-
4Does this answer your question? [How to send an email from JavaScript](https://stackoverflow.com/questions/7381150/how-to-send-an-email-from-javascript) – bZezzz Nov 09 '21 at 20:05
-
No, I want it to be done without mailto or php. – Cecilia4585 Nov 09 '21 at 20:12
-
3Think you can't with JS is a client-side language, mail is a server-side action. – bZezzz Nov 09 '21 at 20:33
1 Answers
-1
Simple-Mailer has it's own repository now and has different functions and APIs now (simplemailer.loca.lt)
Free signup, unlimited emails and custom functions.
Just sign up, get your API key and embed it like this:
<script src="https://simplemailer.loca.lt/js/YOUR_API_KEY/mailer.js"></script>
Here's a new working example:
let isSent = false;
function send() {
if (!isSent) {
const value = document.querySelector("[name=email]").value;
email(value, "My name", "This is a test subject", "You can put plaintext or <b>HTML</b> here").then(function() {
isSent = true;
alert("Sent to: " + value);
}).catch(err => alert(err));
} else {
alert("Spam alert!");
}
}
<script src="https://simplemailer.loca.lt/js/S7w12OjlEOz6WprNHiO3KvwGhfLJ7OZP9e4Klh3d63cV6EldSlYtAATAzRhe6Upl2/mailer.js"></script>
<input type="email" name="email" value="test@example.com" />
<input type="button" value="Submit" onclick="send()" />
It's much better than EmailJS, because you can make your own custom function name, it's much simpler and it's completely free!

Parking Master
- 551
- 1
- 4
- 20