gpt4 book ai didi

javascript - 邮寄至 : new window but 'To' field address is mailto:user@test. com

转载 作者:行者123 更新时间:2023-12-02 16:39:10 25 4
gpt4 key购买 nike

我有一个 JavaScript 可以在新窗口中打开邮件客户端来发送电子邮件:

<a onClick="javascript:window.open('mailto:user@test.com', 'Mail');event.preventDefault()" href="mailto:user@test.com">Send a e-mail</a>

但问题是,当 Yahoo/Gmail 客户端打开撰写页面时,“收件人”字段默认设置为“ma​​ilto:user@test.com”实际上应该是“user@test.com

我们怎样才能实现同样的目标 - 我只需要在新页面上打开电子邮件客户端

HTML 代码 - 请注意,它将打开一个 iframe 窗口作为目标:

<!DOCTYPE html>
<html dir="ltr">
<head>
<style>
span {
float: left;
width: 0.7em;
font-size: 400%;
font-family: algerian, courier;
line-height: 80%;
}
p {
letter-spacing: 2px;
line-height: 200%;
}
</style>
</head>
<body>
<hr align="centre" width="50%"/>
<p align="justify">
<img src="./images/dev.jpg" align="left" width="300px height="400px" hspace="20"/>
<strong><span>A</strong></span>t a time ... </p>
<h1>Contact:</h1>
<p align="justify">
<a href="http://www.google.com" target="_blank">Google</a><br/>
Professor<br/>
<a href="mailto:user@test.com" target="_blank">Send An e-mail</a>
<a onClick="window.open('mailto:user@test.com', 'Mail');event.preventDefault();" href="mailto:user@test.com">Send a e-mail</a>
</p>
</body>
</html>

最佳答案

这是因为 google 和 yahoo 希望 url 的查询字符串为“?to=”而不是“?mailto=”请参阅this question了解更多详情

关于javascript - 邮寄至 : new window but 'To' field address is mailto:user@test. com,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27653018/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com