When applications like the Mozilla browser crash, they launch bug-submission programs. These programs ask users if they would like to submit bug reports. If the users do, the programs ask them to enter as much information as they can about what they were doing when their programs crashed. This information, along with anything that the bug-submission programs can figure out on their own, goes to central email drops for developers and project managers to read.
This is extremely useful for developers. Since the programs are running on client machines, this is the only way to get information about bugs that the developers can't reproduce on their development systems. They can also monitor the frequency and severity of specific bugs to decide which ones to fix first.
Place code inside a wrapper that allows the user to submit an email containing detailed error information.