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."
In the end, this is all about respect for your recipient. If you’re offering a real solution to a real problem, people want to know about it. By following proper and well_understood formats and keeping your writing clear and engaging, you’re making it easier for them to solve their problem. Provided that you’re honest and have the skills and talents to back up your claims, writing a good, solid letter makes it more likely that both you and your reader will be satisfied. Try it the next time you have to write an important letter.