Answers for "onclick send to email javascript"

0

onclick send to email javascript

function sendMail() {
    var link = "mailto:[email protected]"
             + "[email protected]"
             + "&subject=" + encodeURIComponent("This is my subject")
             + "&body=" + encodeURIComponent(document.getElementById('myText').value)
    ;
    
    window.location.href = link;
}
Posted by: Guest on October-22-2020
0

onclick send to email javascript

<textarea id="myText">
    Lorem ipsum...
</textarea>
<button onclick="sendMail(); return false">Send</button>
Posted by: Guest on October-22-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language