My requirement is to send the content of the page through mail on click of a button.when the user will click on the the send mail button then entire content of the page within the form tag should be sent to the mail mentioned by me. I am trying the following but didnt work:
function fnSendMail()
{
var link = "mailto:me@example.com"
+ "?cc=myCCaddress@example.com"
+ "&subject=" + encodeURIComponent("This is my subject")
+ "&body=" + encodeURIComponent(document.getElementById("colMain").innerHTML);
//alert(link);
window.location.href = link;
}
ColMain is the id of the main div withing which content will be there. The above code is breaking at the last line. Can any one please help me out for teh same. Thanks in advance!!