2

I would like to create a contact button that let user choose how to send the email :

I would like to have 3 options at least (4 would be great) :

  1. Desktop email software -> DONE : href="mailto:exemple@mail.com?subject=Contact from..&body=Hello..,"
  2. Gmail (web) -> DONE : href="https://mail.google.com/mail/?view=cm&fs=1&to=exemple@mail.com&su=Contact from..&body=Hello..,"
  3. Outlook.com (web as gmail) -> TODO
  4. Yahoo (web as gmail) -> TODO

1) & 2) are done, works fine, first open user's desktop software and second open in new tab on gmail.com

I now need to make 3) and 4) works but I don't know where to look or it is even possible.

Thank you, Romain.

Romain Derie
  • 516
  • 7
  • 17
  • Until this very day in 2022, option 1 is still a nice approach for clients that resist and keep using desktop Outlook. Thanks! – vortal Jun 01 '22 at 14:33

2 Answers2

5

Outlook is currently buggy for me, but the link should look like this (according to the documentation): https://outlook.office.com/?path=/mail/action/compose&to=to_address&subject=subject&body=body

or this (full-window editor): https://outlook.office.com/owa/#viewmodel=IMailComposeViewModelFactory

see the docs: https://blogs.msdn.microsoft.com/carloshm/2016/01/16/how-to-compose-a-new-message-or-event-and-populate-fields-in-office365/#comment-1645

Yahoo although works fine. Use this: https://compose.mail.yahoo.com/?to=to_address&subject=subject&body=body

If you google these urls, you'll find more parameters.

kuglisb
  • 131
  • 2
  • 5
3

Microsoft has update their url, Found this while opening compose in new window.

url path looks like this:

Outlook

(full-window): https://outlook.live.com/mail/0/deeplink/compose?popoutv2=1&to=johndoe@mail.com&subject=message&body=hey!

Yahoo works fine with @kuglisb's answer as

Yahoo mail:

https://compose.mail.yahoo.com/?to=to_address&subject=subject&body=body

Thank you.

Mayukh Pankaj
  • 151
  • 2
  • 5
  • Clicking on the outlook URL isn't working for me. And this looks more like a comment to kuglisb's answer, than and answer of its own. – Gangula Sep 24 '21 at 18:59
  • @gangula, outlook must have redirected to login page, Just login, with remember me selected, and it will redirect to mail compose page. I did my own research while writing this answer. – Mayukh Pankaj Oct 23 '21 at 20:21
  • Actually, the outlook URL you have works only for personal Microsoft accounts. I was testing this in my office PC so I was being redirected to sign-in. But I noticed that the URL is same for professional accounts too. Only difference is `0/` before `deeplink/`: https://outlook.office.com/mail/deeplink/compose?popoutv2=1&to=johndoe@mail.com&subject=message&body=hey!. And this URL works for both personal and professional accounts. – Gangula Oct 23 '21 at 20:27
  • Removing the `0/` works for me. My guess is the `0/` part allows you to specify the account if you're signed-in to multiple accounts in same browser – Gangula Oct 23 '21 at 20:32
  • I like this answer, has anyone found a way to pass HTML in the body, add attachments, or even documentation displaying possible url parameters? – M. Rogers Aug 08 '22 at 19:22