我正在尝试添加一个mailto按钮以使用电子邮件客户端发送电子邮件 这是我的代码:
clickEmail(e) {
let storyId = this.refs.storyToEmail.getAttribute('id');
if (storyId != undefined) {
let urlToSend = this.createURL(storyId) + "?ref=emailShare";
let subjectLine = "Shared story - " + this.props.headline;
let hrefValue = "mailto:?subject=".concat(subjectLine, "&body=", "I thought you might find this interesting:%0D%0A %0D%0A", urlToSend, "%0D%0A %0D%0AConnecting Communitie %0D%0A %0D%0A");
let email = this.refs.storyToEmail;
email.href = hrefValue;
return email.href;
}
}
但是,这对我和几乎所有台式机都适用,并且不适用于许多移动设备。 搜索后,我注意到它需要浏览器的许可,如下所示: https://blog.hubspot.com/marketing/set-gmail-as-browser-default-email-client-ht
但是问题是我仍然无法按照手机(chrome)链接中的建议进行设置?
有人可以阐明这一点吗?