Here's some quick advice that has worked very well for me - in reverse order of importance.

-------------

3. KEEP IT SHORT.

Respect that the time of the person reading your letter is valuable. Three paragraphs maximum. These should be:
1) Where you saw the advert and why you are interested.
2) Specific details that make you stand out.
3) An invitation to read your CV and schedule an interview.
The goal of the cover letter should be to get people to read your CV. The goal of your CV should be to get an interview. The goal of the interview should be to find out if you and the company are a good fit.

2. SHOW WHY YOU'RE A GOOD MATCH.

Keep it to three points maximum. Focus on how you match the job description.

1. JOB APPLICATIONS ARE ABOUT THE COMPANY, NOT ABOUT YOU.

Don't harp on about yourself. Highlight the benefits that you can bring to the company. If you're starting too many sentences with "I like..." or "I want..." then you're doing it wrong.

-------------

Here are some examples from my sent mail folder, all of which got me interviews - and job offers.

-------------

EXAMPLE 1: SYSADMIN POSITION IN ACADEMIA

Dear [contact],

Re: [job-title] [link-to-job-advert]

The post above was mentioned to me by your colleague [X] and I am very interested in it. Please find my CV attached for your consideration.

For this particular post I would like to highlight a couple of points from my CV that might be of interest to you:

- experience of system administration in an academic environment

- very strong Linux and programming skills

- experience in an international environment

I do hope very much we can meet to discuss your requirements in more detail.

With best regards,
[name]

-------------

EXAMPLE TWO: LINUX MOBILE PHONE SOFTWARE ENGINEER

Dear [contact-name],

Thank you for taking time to speak to me on [date]. The [X] project sounds very interesting and I would very much like to discuss how I can help. I have attached my CV in French and also a direct English translation.

I would like to highlight two points that I believe are particularly relevant to [company-name]:

- I have previous experience of embedded systems programming: during my year out I developed the software for a precision testing machine (20 000 lines of C in 6 months). I worked closely with a team of electronic and mechanical engineers during the project, which was completed on time and on budget.

- I am a developer for [Y] Linux, a distribution which is being increasing used for embedded systems. If you are considering using Linux either in your phones or in-house I can offer specific expertise.

Please do not hesitate to contact me if you need further information, and I look forward to discussing your requirements in more detail in the near future.

Yours sincerely,
[name]

-------------

EXAMPLE 3: BACK-END DEVELOPER FOR INTERNET START-UP

Dear [company-name],

I'm very interested in the Back-end Developer job at [company-name] advertised
on [job-site-name] and on your website.

In particular, I can offer [company-name]:

- very experienced developer, including many years of PHP, JavaScript and MySQL experience

- expert in Linux, including Apache and system administration

- experience of building successful communities - I've been instrumental in evolving [sports-website] into the most popular website for [participants] in the world with over [X] thousand members

Please find my CV attached for your consideration. You can find code from my personal projects, many including PHP, AJAX, XML and geographical services, at:
[link-to-my-github-page]

I do hope that we meet to discuss your requirements in more detail.

Yours faithfully,