What does `mailto:` do when there is no email client?

后端 未结 5 2310
忘掉有多难
忘掉有多难 2021-02-20 10:08

I am developing a website.

What does mailto: open in if there is no email client (like Outlook, Thunderbird, etc.)? It works on my computer, which has Outlo

5条回答
  •  闹比i
    闹比i (楼主)
    2021-02-20 10:37

    What happens is entirely up to the client. The OS defines protocol handlers for protocols like mailto: or tel:, etc.

    You would need access to the client's registry (in case of a Windows system) to manipulate the handling application for your protocol handler.

    For Outlook 2013 as the designated handler, the according Registry structure looks like this:

    [HKEY_CLASSES_ROOT\mailto]
    @="URL:mailto"
    "EditFlags"=hex:02,00,00,00
    "URL Protocol"=""
    
    [HKEY_CLASSES_ROOT\mailto\DefaultIcon]
    @="C:\\PROGRA~2\\MICROS~1\\Office15\\OUTLOOK.EXE,-9403"
    
    [HKEY_CLASSES_ROOT\mailto\shell]
    @="open"
    
    [HKEY_CLASSES_ROOT\mailto\shell\open]
    
    [HKEY_CLASSES_ROOT\mailto\shell\open\command]
    @="\"C:\\PROGRA~2\\MICROS~1\\Office15\\OUTLOOK.EXE\" -c IPM.Note /mailto \"%1\""
    

    with a corresponding structure under HKCU.

提交回复
热议问题