guidox / Software

Fix a mailto Link That Opens Nothing or the Wrong App

TL;DR

Test with **Start-Process mailto:test@example.com**, then read **HKCR\mailto\shell\open\command**. A handler without **%1** opens an empty mail window; a missing handler opens nothing at all.

Before you start

Requirements

  • Windows 11
  • A mail program
  • 10 minutes
Step by step

Instructions

01

Reproduce the failure outside the browser

A browser can block the handoff even when the handler is fine. Starting the URI directly separates the browser from the protocol registration.

Start-Process 'mailto:test@example.com?subject=Test'
Get-Process | Where-Object MainWindowTitle -match 'Mail|Outlook|Thunderbird' | Select-Object Name,MainWindowTitle
Get-WinEvent -LogName Application -MaxEvents 30 | Where-Object Message -match 'mailto' | Select-Object TimeCreated,Id,Message -First 3
02

Read the registered command line

The handler is a command with a placeholder. **%1** receives the address; without it the app starts but the fields stay empty, which looks like a broken link.

Get-ItemProperty 'HKCR:\mailto\shell\open\command' -ErrorAction SilentlyContinue | Select-Object '(default)'
Get-ItemProperty 'HKCR:\mailto' -ErrorAction SilentlyContinue | Select-Object '(default)','URL Protocol'
Get-ItemProperty 'HKCR:\outlookmail\shell\open\command' -ErrorAction SilentlyContinue | Select-Object '(default)'
03

Check the user's own choice

A per-user ProgId overrides the machine registration and is protected by a hash. A wrong or stale entry here is the usual reason a correct handler is never used.

Get-ItemProperty 'HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\mailto\UserChoice' -ErrorAction SilentlyContinue | Select-Object ProgId,Hash
Get-ChildItem 'HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations' | Select-Object PSChildName
Test-Path 'HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\mailto\UserChoice'
04

Reset the choice through Settings

Only the Settings UI can write a valid hash. Picking the mail app there rebuilds the user choice and replaces a stale ProgId in one step.

Start-Process ms-settings:defaultapps
# Settings > Apps > Default apps > the mail app > Set default
# then scroll to the protocol list and confirm mailto
Get-ItemProperty 'HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\mailto\UserChoice' | Select-Object ProgId,Hash
05

Repair a handler that never registers

An app that is installed but not repaired has no valid ProgId, so it never appears in the list. Repairing the installation rewrites the registration and the placeholder.

Get-ItemProperty 'HKCR:\Applications\OUTLOOK.EXE\shell\open\command' -ErrorAction SilentlyContinue | Select-Object '(default)'
Test-Path 'HKCR:\outlookmail\shell\open\command'
# Settings > Apps > Installed apps > the mail app > Advanced options > Repair
06

Verify from a real link

The test is a click, not a command. A mail window with the address and subject filled in means the placeholder and the choice are both correct.

Start-Process 'mailto:test@example.com?subject=Final%20test&body=Hello'
Get-ItemProperty 'HKCR:\mailto\shell\open\command' | Select-Object '(default)'
Get-ItemProperty 'HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\mailto\UserChoice' | Select-Object ProgId
Troubleshooting

Common issues

The mail window opens empty

The handler's command line lacks %1. Repair or reinstall the mail app; the shell cannot add the placeholder for it.

Nothing happens at all

No handler is registered, or the user choice points at a removed app. Set the default again in Settings.

It works in one browser only

The other browser blocks protocol launches or asks for confirmation. Check its settings for external protocol handlers.

A new mail app keeps taking over

Installers register themselves. Set the default once after the install and ignore the installer's prompt.

FAQ

Frequently asked

Where is this different from file associations?

File types use extensions and ProgIds under HKCR\.ext; protocols use URL Protocol keys and UrlAssociations. Separate paths, separate user choice.

Can I fix it by editing the registry?

The machine handler yes, the user choice no. Windows validates a hash on the user choice and resets anything it did not write.

Does a system reset restore it?

A reset clears the user choice, so the default app question returns and can be answered cleanly.

How to undo this

Set the protocol back to the previous app in Settings > Apps > Default apps, or delete the UserChoice key to let Windows ask again after a sign-out.

Changelog · 1 entry
  1. 2026-11-01
    First version
Interactive version: checklist, feedback, related guides →

Free · no account needed · tracks your progress