title: Typescript/Javascript: mailto with subject, body and array of links
body: <p>I work on Angular 4. On click of hyperlink I have to open outlook, in the mail I will have to send 4 links. So I have planned to call a <code>mailto</code> from my typescript file. My code is</p>
  
  <pre><code>    &lt;span (click)="mailMe()"&gt;Mail me the links&lt;/span&gt;
  
  
      var links= ["link1.com", "link2.com", "link3.com"];
      mailMe(){
          console.log("111111");
          var mail = document.createElement("a");
          console.log("22222");
          mail.href = "mailto:abc@abc.com?subject=files&amp;body=Hi";
          mail.click();
      }
  </code></pre>
  
  <p>I am able to call the function but mail is not popping up. In console <code>111111</code> is getting printed but <code>22222</code> is not getting printed. Where did I go wrong? OR is there a way I can send the array of links from HTML itself?</p>