Javascript 在 mailto 上打开 Gmail:操作
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6988355/
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
Open Gmail on mailto: action
提问by Sergey Metlov
How to force web-browser to navigate to Gmail and create (if logged in) new letter with filled in field 'To' on click on mailto:[email protected]
?
如何强制网络浏览器导航到 Gmail 并创建(如果已登录)新信件,并在单击时填写“收件人”字段mailto:[email protected]
?
回答by Vlad
There's a Greasemonkey script. The compose url is:
有一个Greasemonkey 脚本。撰写网址是:
https://mail.google.com/mail/?view=cm&fs=1&[email protected]
https://mail.google.com/mail/?view=cm&fs=1&[email protected]
回答by Manjeet Kumar Nai
<a href="https://mail.google.com/mail/?view=cm&fs=1&tf=1&[email protected]" target="_blank">Title</a>
回答by Corey Ogburn
mailto is one of many Url Protocols and it's a way for commands to exit the browser and interact with other applications. I can't find a good site defining what a Url Protocol is but here's how one is registered, it also describes how one is called: http://msdn.microsoft.com/en-us/library/aa767914(v=vs.85).aspx
mailto 是众多 Url 协议之一,它是命令退出浏览器并与其他应用程序交互的一种方式。我找不到定义 Url 协议是什么的好网站,但这里是注册方式,它还描述了如何调用:http: //msdn.microsoft.com/en-us/library/aa767914(v=vs .85).aspx
As a web developer, you won't be able to twist mailto to do what you want on your site. You can use this link:
作为 Web 开发人员,您将无法扭曲 mailto 以在您的网站上执行您想要的操作。您可以使用此链接:
https://mail.google.com/mail/?view=cm&fs=1&tf=1&[email protected]
Not suggested though. Anybody who clicks it needs to be signed into their gmail account (if they have one), but it technically works if the user has gmail and is signed in.
虽然不建议。任何点击它的人都需要登录他们的 gmail 帐户(如果他们有),但如果用户拥有 gmail 并且已登录,那么它在技术上是有效的。
As a user, if you want other sites' mailto links to take you to gmail, then whatever browser you have is bound to have an extension or plug-in you can use that will manipulate mailto links to the link I gave you above.
作为用户,如果您希望其他站点的 mailto 链接将您带到 gmail,那么您所拥有的任何浏览器都必须有一个扩展程序或插件,您可以使用它们来操纵 mailto 链接到我上面给您的链接。
回答by Bhagawat
Above works also works. I tried following link in my <a>
tag.
https://mail.google.com/mail/u/0/#inbox?compose=new
以上作品也有效。我尝试在我的<a>
标签中点击链接。
https://mail.google.com/mail/u/0/#inbox?compose=new
回答by YetAnotherUser
回答by Derzu
To add Subject, Body, CC, and BCC, just add the parameters to the URL:
要添加主题、正文、抄送和密件抄送,只需将参数添加到 URL:
- Carbon Copy (CC) is the parameter "cc"
- Blind Carbon Copy (BCC) is the parameter "bcc"
- Subject is the parameter "su"
- Body is the parameter "body"
- 抄送 (CC) 是参数“cc”
- 密件抄送 (BCC) 是参数“密件抄送”
- 主题是参数“su”
- 身体是参数“身体”
Example:
例子:
Or:
或者:
<a href="https://mail.google.com/mail/?view=cm&fs=1&[email protected]&[email protected]&[email protected]&su=SUBJECT&body=BODY" target="_blank">Mail Us</a>