邮件值未显示在Outlook,HTML和打字稿中

这里的问题是它不显示消息表单的值,也不知道与此代码有关。这最初是一个javascript代码,但我将其转换为打字稿,我想在Outlook中显示值,但不显示。

     The code below is for HTML file

    <div class="contact-section">
    <img src="/assets/img-01.png">
    <div class="inner-width">
        <h1>Get in touch with us</h1>
        <input type="text" class="name" placeholder="Your Name">
        <input type="email" class="email"  placeholder="Your Email">
        <textarea rows="1" placeholder="Message"  class="message"></textarea>
        <a class="btn-submit" onmouseover="appendMailTo()" id="sendMail" 
        href="mailto:random12@gmail.com?Subject=Hello%20again" >Get in
            touch </a>
    </div>

   The code below is for the ts file 

   appendMailTo(){
  let message = (document.getElementById("message") as HTMLInputElement).value;
  let subject = document.getElementById("mailSubject")
  console.log(subject);
  console.log(message);

 let mailToAttr = document.getElementById("sendMail");
 mailToAttr.setAttribute("href", "mailto:randoms12@gmail.com? 
 subject="+subject+"&body="+message);
 }
评论