Html href="mailto:" 不适用于任何浏览器
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/34129707/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
href="mailto:" is not working on any of the browsers
提问by A J A Y
I have created a webpage with some hyperlinks (not online yet).
我创建了一个带有一些超链接的网页(尚未在线)。
I'm supposed to include certain hyperlinks for the Email IDs on the page.
我应该在页面上包含电子邮件 ID 的某些超链接。
I tried to create links in this format:
我尝试以这种格式创建链接:
<a href="mailto:[email protected]">
But these are not opening up using the outlook's new mail as it is supposed to.
但是这些并没有像预期的那样使用 Outlook 的新邮件打开。
On Chrome, it does nothing. On Firefox, IE & Safari it opens a new blank Chrome Window when I click on the link.
在 Chrome 上,它什么也不做。在 Firefox、IE 和 Safari 上,当我单击链接时,它会打开一个新的空白 Chrome 窗口。
This system is new and has all the above browsers up to date.
这个系统是新的,上面所有的浏览器都是最新的。
采纳答案by Vaikesh
If you are using Windows 7 or higher, then all you have to do is set the default email client. Check this in the control panel under Default Apps
setting.
Just click on the email client you want and you are all set.
如果您使用的是 Windows 7 或更高版本,那么您所要做的就是设置默认电子邮件客户端。在Default Apps
设置下的控制面板中检查此项。只需单击您想要的电子邮件客户端,一切就绪。
回答by Matt
Provided you have registered a default email client, this usually works if you're using an <a>
tag as follows:
如果您已经注册了默认的电子邮件客户端,这通常在您使用<a>
如下标签时有效:
<a href="mailto:[email protected]">Mail me</a>
To change or check the email client settings,do the following (cited from MSDN) - I have modified it slightly because it differs depending on the Windows version you're using:
要更改或检查电子邮件客户端设置,请执行以下操作(从MSDN引用) - 我已对其稍作修改,因为它因您使用的 Windows 版本而异:
Depending on the Windows version:
Open Default Programsby clicking the Windows Start button, and then clicking Default Programs.
Or:Open the Control Panelin the Start Menu*), then use the search text boxin the upper right corner of the Control Panel screenand typeDefault Programs
there. Hit Enter.Click Set your default programs.
Under Programs, click the Emailprogram you'd like to use, and then click Set this program as default.
Click OK.
根据不同的Windows版本:
打开默认程序通过单击Windows开始按钮,然后单击默认程序。
或者:打开控制面板中的开始菜单*) ,然后使用搜索文本框在的右上角控制面板屏幕,并输入Default Programs
在那里。击中Enter。单击设置您的默认程序。
在程序下,单击您要使用的电子邮件程序,然后单击将此程序设置为默认程序。
单击确定。
Note
笔记
The first time you start them, some e?mail programs display a message asking you if you want to use that program as the default. If you choose to do so, this program will become your default e?mail program, even if you've chosen a different program using Set your default programs earlier.
第一次启动它们时,一些电子邮件程序会显示一条消息,询问您是否要使用该程序作为默认程序。如果您选择这样做,该程序将成为您的默认电子邮件程序,即使您已使用早先设置默认程序选择了不同的程序。
*)In , you can find the Control Panel,if you open the Windows menu , then click on the cogwheel icon , then enter "Control Panel" in the search box.
回答by alexis
I had this exact same problem, it seems at a glance to be a Microsoft Windows 10 issue, not supporting emails properly. Like matt suggested, go to default programs but change your email to the default option mail. Thats how I solved the issue.
我遇到了完全相同的问题,乍一看似乎是 Microsoft Windows 10 问题,无法正确支持电子邮件。就像马特建议的那样,转到默认程序,但将您的电子邮件更改为默认选项邮件。我就是这样解决问题的。
回答by ocoloco
Are you sure you are closing the anchor correctly? The full HTML should be this:
你确定你正确地关闭了锚点吗?完整的 HTML 应该是这样的:
<a href="mailto:[email protected]">Test</a>
回答by Vaikesh
Try something like this :
尝试这样的事情:
<!DOCTYPE html>
<html>
<body>
<p>
Click to email :
<a href="mailto:[email protected]?Subject=Hello" target="_top">[email protected]</a>
</p>
</body>
</html>
回答by Litzer
It's a missing permission that you need to apply in CHROME.
这是您需要在 CHROME 中申请的缺失权限。
Found the solution right here: https://blog.hubspot.com/marketing/set-gmail-as-browser-default-email-client-ht
在这里找到解决方案:https: //blog.hubspot.com/marketing/set-gmail-as-browser-default-email-client-ht
You need to go to gmail.com and click on the little double diamond icon that appears in the url bar.
您需要转到 gmail.com 并单击出现在 url 栏中的小双菱形图标。