Button Click Send Email Javascript Code Example
Example 1: onclick send to email javascript
function sendMail() { var link = "mailto:me@example.com" + "?cc=myCCaddress@example.com" + "&subject=" + encodeURIComponent("This is my subject") + "&body=" + encodeURIComponent(document.getElementById('myText').value) ; window.location.href = link; }
Example 2: onclick send to email javascript
<textarea id="myText"> Lorem ipsum... </textarea> <button onclick="sendMail(); return false">Send</button>
Comments
Post a Comment