A letter of recommendation or letter of reference was a letter written by someone who knew an individual well, with the aim of commending them to another.
In 2370, Jean-Luc Picard recalled his search for a first officer, saying that all the personnel records he perused were "filled with lots of dry statistics and glowing letters of recommendation that tell you nothing." (TNG: "The Pegasus")
In order to take the entrance exam for Starfleet Academy, a member of a non-Federation species such as Ferengi required such a letter from a command level officer. In 2371, Nog, unaware of this, asked Captain Benjamin Sisko where he was supposed to sign up for the Academy, only to be told of the requirement. Sisko promised Nog that he'd think about it, later admitting that the boy's reputation on Deep Space 9 as a troublemaker was a problem, rather than his race, as Nog initially believed. When Nog assured him that he could do better, Sisko set out to test him by assigning him the job of doing an inventory of cargo bay twelve.
Impressed with his completion of the task in under five hours with no help, the captain tested him by denying the letter until he told him why he wanted to join, accusing him of having some scheme or profitable opportunity in mind. Nog explained that he didn't want to end up like his father, wasting his life chasing profit with little instinct or ability for it. Satisfied with his answer, Sisko promised to send the letter first thing the next day. (DS9: "Heart of Stone")