Target the recommendation. Is it for an academic post, a job, a volunteer position, a background check, or a personal reference? Write your letter so that it is focused on this purpose. For example, if the letter is part of a job application package, it should focus on the professional qualifications and conduct of the candidate.
Use a business closing and sign your name. Above all, be professional. If the you’re sending a physical letter, print it out and sign it by hand. Otherwise, just typing your name will do.