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."
For instance, in a typical job application, the problem is that the company or organization needs a position filled, and more importantly they need someone who can do the job well and help the organization achieve its mission (which may be more profits, or it may be to save children in Darfur or to end global warming or to cure cancer). You arouse their interest by telling them that you’re the right person for the position and by promising to help them achieve their mission.