If you are writing to someone who has a doctorate or medical degree, use the abbreviated form: "Dr." However, for other titles, such as professor, judge, rabbi, etc., write out the full title and capitalize it. For example, your salutation in a letter to a judge would be, "Dear Judge Barnard." Or, if your correspondence was with a rabbi, you might write, "Dear Rabbi Williams."
Example: During the recent ARRGH convention in Washington, D.C., one of your sales representatives, Dusty Brown, informed me of a possible opening for a manager in your Data Center. My extensive background in programming and my master’s degree in information systems make me highly qualified for the position. In subsequent paragraphs, expand on the qualifications you mentioned in your opening. Add any appropriate details, highlighting experience listed on your resume that is especially pertinent to the job you are seeking. Close with a request for an interview. Proofread your letter carefully.