title: mailto using javascript
body: <p>I want to open a new outlook mail template with the 'To address' whenever a user clicks an image. I have return my code in a html page(linked with the image), whenever it loads the javascript should open a new mail template. But the functionality is not working. Kindly let me know what is wrong in my code.</p>
  
  <pre><code>body onLoad="redirect()"
  
  script language="JavaScript"
  
  function redirect() 
  
        var email = "xyz@something.com"
        var mailto_link = 'mailto:' + email
        window = window.open(mailto_link, 'emailWindow')
        if (window &amp;&amp; window.open &amp;&amp; !window.closed)         
            window.close()
  </code></pre>