Question: I've searched around for a bit, but haven't been able to find anything useful on this.

How do browsers communicate with email programs, such as Thunderbird and Outlook (on the Mac, if that's relevant)?

By communicate, I mean the process it goes through to create a new email window with a designated to address, subject, body, through the mailto: link. How does the browser let the email program know what to put for each field? Using the command line (for Thunderbird, at least) didn't make much sense, as that opens a brand new instance of Thunderbird on the Mac.

I haven't found any sort of API for this, so if someone can point me in the right direction, that would be greatly appreciated. Thanks!

Answer: 
On windows, the browser use the "default" email client defined by the system.

It's stored in the Windows registry and define the command line to open the mail program. You can find more info and an exemple on the Microsoft website.

<http://msdn.microsoft.com/en-us/library/windows/desktop/cc144109%28v=vs.85%29.aspx#sample_mail_program>

If I look in my registry for thunderbird, It seems to execute: 

```
 "C:\Program Files\Mozilla Thunderbird\thunderbird.exe" -osint -compose "%1"

```

I have no idea how it works for the mac!
A very useful oldies that explains the surface called [RCDefault](http://www.rubicode.com/Software/RCDefaultApp/)

It shows you that the Finder or the Browser uses (can use) URLs to call other applications. 

I am attaching the screenshot for the Mail application on OSX here:

![mail application url schemes](https://i.stack.imgur.com/0ug1n.png) 

The OS will then call this application with the URL (or file) and the application is supposed to understand how to open that URL.
The URL scheme for the mailto protocol for apple, is [here](https://developer.apple.com/library/ios/#featuredarticles/iPhoneURLScheme_Reference/Articles/MailLinks.html)

You should be able to find other schemes for the application you need to use.