在新标签页/窗口中打开href mailto链接 [英] Open the href mailto link in new tab / window
问题描述
我有一张图片,单击该图片时,我想链接到一个mailto:
I have an image which when click, I want to link to a mailto:
<a id="mailto" href="mailto:hfms@live.com.my" target="_newtab" >
<img src="@Url.Content("~/Content/HomePage/email.png")" alt="email" /></a>
但是,当前,一旦单击它,它将启动电子邮件选项以选择一个mailto应用程序,一旦我选择,mailto链接将在当前选项卡中打开.这将导致用户离开应用程序.
However, currently once its clicked, it will launch the email option to choose a mailto application, and once i choose, the mailto link is open in the current tab. This will cause user to leave the application.
因此,我希望页面发送电子邮件(通过gmail,yahoo等)在新标签页或窗口中打开.任何想法如何做到这一点?我尝试了target ="_ newtab"和target ="_ blank",但都没有用.
So, I want the page to sent email (by gmail, yahoo, etc ) is either open in new tab or in a window. Any idea how to do this? I tried both target="_newtab" and target="_blank" but both didn't work.
任何帮助将不胜感激..谢谢...
Any help will be much appreciated.. Thanks...
(如果没有其他方法,jQuery方法也是可以接受的,谢谢)
(jQuery method is also acceptable if there is no other way, thanks)
推荐答案
mailto调用用户的默认电子邮件客户端.在任何情况下都不会打开窗口或选项卡.如果要使用窗口或选项卡,则需要配置表单并允许在窗口/选项卡中打开该表单.当然,您必须将表单配置为使用服务器上可用的任何方法发送邮件.
mailto calls the users default email client. It does not open a window or tab in any instance. If you want to use a window or tab you need to configure a form and allow the form to open in your window/tab. Of course, you'll have to configure the form to send mail with whatever method is available on your server.
这篇关于在新标签页/窗口中打开href mailto链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!