title: Mailto link that adds current domain name to subject line
body: <p>I'm trying to create a mailto link that programmatically includes the current domain in the mail subject when clicked.</p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>&lt;div class="cta"&gt;
  Make an enquiry at &lt;a href="javascript:'mailto:sales@hashimaziz.com?subject=Sales%20Inquiry%20RE:%20' + window.location.hostname;"&gt;sales@hashimaziz.com&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The JavaScript itself seems to work, but when the mailto link is clicked, it goes to a white page that prints the text of the <code>mailto</code> command itself. This can be tested on the website itself <a href="https://latestfooty.co.uk" rel="nofollow noreferrer">here</a>.</p>
  
  <p>What's wrong with the <code>mailto</code> link that's preventing it from behaving as it should? </p>