How To Open Email In Javascript
hi i'm looking to send details of form in email after validation but i don't know how i put an alert in where i would like to send the details heres a sample of my code if(compNam
Solution 1:
You can't send an email with javascript, the closest you can get would be a mailto
which opens the default email client - but that won't send anything.
Email should be sent from the server - submit the form in the normal way, and construct the email on the server and send it. How you do this depends on what you are running on the server.
Solution 2:
you can use location.href to that:
var myMailAdressStr = "mailto:xxx@myyyy.zz?subject:Formvalidationbody&body="; + document.getElementById('username').value;
Note: This way opens you default email client and the browser does fill the defined fields. Javascript is unable to send an email in generally. Only serverside languages have got some ways to get an access to an email server and send a mail in real.
Post a Comment for "How To Open Email In Javascript"