You need to encode the text using URL safe characters:
Code:
function emailPage() {
var messageText = 'Hello, I found a great web page at ' + window.location;
var subjectText = 'Check out this Website';
var email = prompt("Enter your friend's email address:", 'email@address.com');
window.location = 'mailto:' + email +
'?subject=' + encodeURIComponent(subjectText) +
'&body=' + encodeURIComponent(messageText);
}
Then to use this function:
HTML Code:
<a href="#" onclick="emailPage(); return false;">Email This Page!</a>
Bookmarks