Skip to content

Instantly share code, notes, and snippets.

@pleabargain
Created February 19, 2017 12:41
Show Gist options
  • Save pleabargain/3f431c90fa396e65cbf25816e4e1c75d to your computer and use it in GitHub Desktop.
Save pleabargain/3f431c90fa396e65cbf25816e4e1c75d to your computer and use it in GitHub Desktop.
html and js to include doc url in mailto:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>JavaScript mailto Attribute</title>
<script type="text/javascript">
let email=('[email protected]');
let x = document.URL;
let subject = ('My Feedback' + x);
let cc = ('[email protected]');
let bcc = ('[email protected]');
let body = ('I am the body of the feedback that you are sending, note the subject line is getting the doc URL. Created using JavaScript.');
document.write('<a href="mailto:' + email +
'?subject=' +subject+
'&cc=' +cc+
'&bcc=' +bcc+
'&body=' +body+
'">' + 'Click here to send feedback about this page' + '<'+'/a>');
</script>
</head>
<body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment