I've been working on a project with a feature so that when I click a button, Outlook will open and the corresponding value stored in a variable will be in the in the body of the mail. I've tried the following code:
<html>
<head>
<title>Email This Code Snippet</title>
<script language="javascript">
function TriggerOutlook()
{
var sub = "Hi friend";
var bodycont = "<html><body>welcome</body></html>";
var body = escape(bodycont + String.fromCharCode(13));
window.location.href = "mailto:[email protected]"
+ "?body=" + body
+ "&subject=" + sub
;
}
</script>
</head>
<body>
<form id="form1">
<a href="#" onclick="TriggerOutlook()">Email this Codesnippet</a>
<input type="text" name="txtbody" id="txtbody">
</form>
</body>
</html>
But the body of the mail is <html><body>welcome</body></html>
in plain text, not HTML. How do I get it formatted as HTML?