Then you need to have an FDA certified kitchen. Without it, it is a violation of federal law with very steep penalties. Your state Dept of Ag will have the application. It basically requires that you have all of the equipment, surfaces, and mechanicals of a restaurant, register with the Bioterrorism Act, FDA issued labels, a recall protocal, and logs of all activity and ingredients.
People, usually the same ones, will respond that I should mind my own business, that nobody cares, and that it wasn't asked to begin with. But since 9/11, the FDA has been serious about the certification. If you make someone sick, don't ship properly, or get caught, it's not your local HD at your door with a warning, it's the feds.
I did not know until I asked the question, and I pass it along when I see it come up. If you already have a completely separate commercial kitchen in an area with strict codes, you may need to do very little to pass inspection. The rest is paperwork that must be kept according to their guidelines for the length specified. This is where the fines add up.
As far as the market, research it online. There are many companies that mail order cookie. Study the structure of each one. Study the trends and keep watching the market for change. There are two basic marketing structures. Either you want to appeal to a national audience for sales, which will require an e-commerce website designed by a professional to compete on the national market, or you will appeal to the local market who may already know you, but may want to send to people in other states. And if you are looking at national sales, your branding will be of the utmost importance... from your logo, site, packaging, and product. And consider the cost of a site that will be able to make it anywhere near the first few pages of a national search.
I built my kitchen to FDA code, but it was close to my local code. Like you, I wanted to be able to ship products. If you already have a kitchen that will pass, testing the waters will be a minimum cash investment, but it will take time. Each recipe must be submitted, analyzed, and a custom label with ingredients, nutritional value, and weight will be issued by the FDA. The recall protocol is actually something all food businesses should have in place.