Contact

Technology

Oct 20, 2017

Associating Mailto Links With Outlook in Windows 7 Through Group Policy

Bobby Crotty

Bobby Crotty

Associating Mailto Links With Outlook in Windows 7 Through Group Policy

Clicking an email address link should open a program that allows you to send an email to that email address. With Windows 7 and before, administrators can (for the most part) make sure the correct program opens. Unfortunately, if administrators aren’t careful they can make email address links do nothing.

One of our clients recently brought that challenge to us, and it was caused by an incorrect Group Policy. They had tried several solutions, so their workstations had various versions of the attempted fixes applied, none of which were working.

First Attempt

My first attempt at solving this problem used Group Policy Preferences to set the (Default) value of the Registry key HKEY_CLASSES_ROOT\mailto\shell\open\command to something like the following:

“C:\Program Files\Microsoft Office\Office15\Outlook.exe” -c IPM.Note /mailto “%1”

The policy changed the above command based on which Outlook executable was found using item-level targeting in the Group Policy Preferences Registry settings. This policy works on Windows XP, but it would get overwritten on Windows 7 when you first clicked an email address.

The Solution

In Windows 7 and later the mailto association is no longer set system-wide and can be different for each user. The association is controlled by the user-specific value ProgId in the Registry key HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\mailto\UserChoice. If you set the ProgId value data to Outlook.URL.mailto.15, then when a program tries to use the mailto protocol, Windows will update the command key with the appropriate value and the correct program will open, regardless of what’s in the command key from earlier. Using Outlook.URL.mailto.15 works for both Office 2013 and Office 2016, and it saves you from needing to find the Outlook executable file, which can be in several locations depending on the bit-level and install type.

Protecting the Mailto Association

To protect the mailto association, I also followed Wayne Jessee’s instructions in this post, which shows how to prevent Gmail and Google Calendar from asking about becoming the default handler for the mailto and webcal protocols. It will only prevent this if users have not set Gmail or Google Calendar as the default handler before. This Registry entry will not override any previous settings.

Warnings

Note that this no longer works in Windows 8 and later because the ProgId value is paired with a Hash value that can only be set by Windows. This makes sense to protect the user from overeager programs that steal associations, but it creates a challenge for developers and administrators. Going forward, users will need to change the file and protocol associations on their own. Applications can still help open Default Apps for users, but they will need to make the change.

Setting the ProgId also does not work if Chrome already has a mailto handler set. If that’s the case, users need to open the Handlers section of Chrome’s settings (chrome://settings/handlers) and change the dropdown next to mailto to “(none)”. Then they need to go to Default Programs in the Control Panel (Default Apps in Settings for newer operating systems) and set Outlook as default for mailto.

I tried setting all the Registry Group Policies above to apply only once so that users can change this if they want to, but it didn’t apply in some cases, so ultimately I left it set to apply every time policies are applied. If users have a mailto handler set in Chrome, the changes will get set and then reverted, so they’ll need to change the default to Outlook manually.

Outlook Web Access

For computers without Outlook installed I wanted to associate mailto with Outlook Web Access (OWA) in Chrome, so I used Group Policy Preferences again to set the same Registry value from Wayne’s post (RegisteredProtocolHandlers in HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\Recommended) to have the following value:

[{“default”: true, “protocol”: “mailto”, “url”: “https://outlook.office.com/owa/”}\]

This opens OWA but does not start composing a message. OWA supports passing an email address with the URL to open a compose window directly, but unfortunately Chrome passes the “mailto:” part of the link as well as the email address, which gets put into the To field and prevents sending the message until you delete it.

Next Steps

Managing these settings in an enterprise environment is possible, but each situation is different, and each new version of Windows adds further complications. Need help deciding, designing, implementing, or troubleshooting Group Policy? Have other questions about enterprise configuration management? Credera has extensive experience in infrastructure design and implementation. We would love to discuss potential configuration management solutions with you. Contact us at findoutmore@credera.com.

Conversation Icon

Contact Us

Ready to achieve your vision? We're here to help.

We'd love to start a conversation. Fill out the form and we'll connect you with the right person.

Searching for a new career?

View job openings