使用 Window.open mailto: 从我的应用程序发送电子邮件。它打开电子邮件软件并填写发送电子邮件的人,但我似乎无法填写主题字段。
methods: {
email: function(event) {
let mail =
"mailto:Test@gmail.com?" +
"&subject=" +
escape("This is my subject");
window.location.href = mail;
}
}
最佳答案
如果它是唯一的参数,则不应包含 &
methods: {
email: function(event) {
let mail =
"mailto:Test@gmail.com?" +
"subject=" +
encodeURIComponent("This is my subject");
window.location.href = mail;
}
}
关于javascript - 使用 mailto : won't fill subject field 发送电子邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57830270/