html - 消息值未显示在 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);
}
解决方案
出于安全目的,Outlook 会阻止邮件正文中的任何脚本。请参阅电子邮件中是否支持 JavaScript?了解更多信息。
推荐阅读
- c++ - 用 X C++ 练习替换字符串中的字符
- python - 单个类中的 Python 函数调用
- azure - Azure Function 部署缓慢
- javascript - 如何在 ionic 3 中实现进度条?
- python - python 中的 os.listdir() 不显示目录的所有文件。它跳过了其中的几个
- c# - Xamarin Forms - 识别设备是否以纵向模式锁定
- javascript - 画布中对象之间的碰撞检查始终为正
- sql - Amazon Redshift:连接列内容略有不同的两列
- html - 禁用文本在 IE 和 Microsoft Edge 的网页上不起作用
- javascript - 如果文件上传未在 dropzone js 中完成,则禁用提交按钮