A friend passed this on to me years ago, still as appropriate as ever:

Dear Editor,

Thank you for your recent rejection slip. As it does not quite fit my present requirements, I am returning it. This in no way reflects upon its merits. Don’t be discouraged. I read your rejection slip with great interest. I appreciate your thinking of me and wish you the best of luck in placing your rejection slip elsewhere.

Literally,

Just another writer

PS: Please forgive this form letter. I’d like to comment on each rejection slip, but the large number I receive makes it impossible to answer each one personally.