Many writers are uncertain about how to send a query letter to a publisher. While I am no expert, I have sent a few successful queries. This is my method.
I am by no means an expert on querying publishers, but I have had a couple of books accepted based on queries I sent so thought I would share what little I know on the subject, and what works for me.
A query usually consists of a cover letter, a synopsis (which reveals the ending) of the story and the first three chapters or 50 pages.
In the cover letter you should be professional, polite, tell them right off who you are; what your story is about. If they have published similar material to your story, say something like: "My story is on a similar theme to Joey's big Adventure." but also include why it might not be just more of the same and why you think it would suit their line. (this is not a synopsis, just a brief description)
Let the editor know if you've sent the work to anyone else simultaneously. Also let them know if it has ever been published before and if so, make sure you have the full rights to the work back.
Thank them for their time, give all relevant contact info and close the letter. These letters should never be more than one page long. Editors are busy. They're much the same for email and snail mail.
One thing that annoys editors and agents, is receiving submissions of work that do not resemble in any way, anything they have represented or published in the past. It's a waste of his/her time reading these presentations when they're not going to want to pick it up, so do your homework and submit only to editors and agents who're looking for what you write. It will increase your chances of acceptance immensely. Also, make sure your submission adheres religiously to any guidelines about how to set out the manuscript.
Don't be arrogant, or overbearing. Don't tell the editor that "This is the book you're looking for!!" She's likely to toss it unread.
It's very much like applying for a job. Sell yourself and your work, but don't be a pain in the process.