0

I have an email page on my website with a form and tinyMCE and all that fancy stuff, but I also want to add a couple of links to the popular mail servers such as gmail, yahoo, and hotmail.

I've seen some links that go to the my Microsoft Office Outlook (which I never use), and I've also seen a gmail link that opens up gmail in a new tab with a form already open and a mailto: value already given. Just wondering how this is done if I, lets say, have a mailto: value to send and perhaps a subject and message.

Just to make it clear, I want three or four image links on my page, each one for a different mail server (gmail, yahoo...) and when clicked on, it opens a form partly filled out (a mailto:value and possibly a subject and/or message) fullscreen. Thanks.

BestAnswer
  • 136
  • 1
  • 18
  • You could do something like `https://mail.google.com/mail/?view=cm&fs=1&to=email@domain.com` for Gmail ([source](http://stackoverflow.com/questions/6988355/open-gmail-on-mailto-action)) but that would require you to regularly check if those links are still working, so I wouldn't recommend it. – user247702 May 13 '14 at 22:02

1 Answers1

1

It's not going to be easy, as you'll have to integrate with each one of these services. How about going at it a different way? For GMail (at least on Chrome) you can figure the web app as the handler for your mailto: links. With that, you can create a link that opens GMail, optionally with subject and body filled in. See RFC2368 for details, or try this link.

Most users don't have accounts on all of the web mail services you mentioned anyways, and using the mailto link allow the mail to the sent using the user's default e-mail client (may it be Outlook, or GMail) which most people prefer anyways.

Community
  • 1
  • 1
Adrian Pang
  • 1,125
  • 6
  • 12
  • So does all this `mailto:?to=......` stuff go inside a link like so: `service`? – BestAnswer May 13 '14 at 22:30
  • Yup, a href="mailto:..." – Adrian Pang May 13 '14 at 22:37
  • I tried that and it pulls up Microsoft Outlook, and I use Gmail... regularly. How does it decide which server to pull up? – BestAnswer May 13 '14 at 23:58
  • No, but your system is configured to use Microsoft Outlook as default e-mail client. Which browser do you use? – Adrian Pang May 14 '14 at 16:56
  • Follow instructions here: http://blog.hubspot.com/marketing/set-gmail-as-browser-default-email-client-ht will allow you to register GMail to handle mailto: links. – Adrian Pang May 15 '14 at 22:50
  • Thanks. So, then should I just have a link that says something like `Email from Default Service` and then it will just go to whatever they have as default? Is Outlook default for most people? – BestAnswer May 15 '14 at 23:55
  • 1
    That sounds like a good idea -- for the default, it depends on your users. Outlook is only common among Windows machines (even though it's available on Macs but personally I think there are better alternatives) and not available on mobile devices. – Adrian Pang May 16 '14 at 05:04