Open Gmail on mailto: action

前端 未结 6 2070
借酒劲吻你
借酒劲吻你 2020-12-05 06:58

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:SomeMail@blabla.com?

相关标签:
6条回答
  • 2020-12-05 07:39

    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

    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:

    https://mail.google.com/mail/?view=cm&fs=1&tf=1&to=target@email.com
    

    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.

    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.

    0 讨论(0)
  • 2020-12-05 07:47

    There's a Greasemonkey script. The compose url is:

    https://mail.google.com/mail/?view=cm&fs=1&to=email@domain.com

    0 讨论(0)
  • 2020-12-05 07:48

    To add Subject, Body, CC, and BCC, just add the parameters to the 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"

    Example:

    https://mail.google.com/mail/?view=cm&fs=1&to=someone@example.com&cc=someone@ola.com&bcc=someone.else@example.com&su=SUBJECT&body=BODY

    Or:

    <a href="https://mail.google.com/mail/?view=cm&fs=1&to=someone@example.com&cc=someone@ola.com&bcc=someone.else@example.com&su=SUBJECT&body=BODY" target="_blank">Mail Us</a>
    
    0 讨论(0)
  • 2020-12-05 07:49

    Above works also works. I tried following link in my <a> tag. https://mail.google.com/mail/u/0/#inbox?compose=new

    0 讨论(0)
  • 2020-12-05 07:59

    Probably this would help -

    Set Gmail as your default email client in Firefox 3

    Making Gmail your default mail application - Gmail Help

    0 讨论(0)
  • 2020-12-05 08:02
    <a href="https://mail.google.com/mail/?view=cm&fs=1&tf=1&to=someone@gmail.com" target="_blank">Title</a>
    
    0 讨论(0)
提交回复
热议问题