In Active Voice, a sentence emphasizes subject performing an action.
In Passive Voice, a sentence emphasizes the action or the object of the sentence.
The given sentence is in the active voice and 'She' is the subject and 'the letter' is the object.
When we convert this sentence into passive voice, the subject 'She' of the active voice becomes the object, the object 'the letter' becomes the subject.
The passive format "had + been + third form of the verb (V3)" is used.
This is the active and passive voice rule for the past perfect tense.
Hence, "The letter had been posted by her" is the correct passive voice.