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."
Guidelines for Names and Titles: The salutation should typically use the person's last name, along with a "Mr." or "Ms." In general, avoid using "Mrs." or "Miss" unless you are certain of how the woman wants to be addressed. When in doubt, default to using "Ms."