Dear {Hiring Manager},
Thank you for letting me know your decision regarding the {job title} position. While I'm disappointed to learn that I was not selected, I greatly appreciate the opportunity to speak with you and learn more about {company}.
I hope that you'll keep me in mind for future openings. I would also be interested in any feedback you may have regarding my application and interview.
Thank you again for your time. I wish you and everyone at {company} all the best.
Sincerely,
{Your Name}