Which sentence uses the word them as an indirect object?

A.
To me, astronauts are heroes, so I like to read about them.

B.
I enjoy books about the space industry, so I often borrow them from the school library.

C.
The content of the book about aeronautics was a bit of a mystery to them.

D.
After my grandparents sent me a book about aeronautics, I wrote them a thank-you note.

D. After my grandparents sent me a book about aeronautics, I wrote them a thank-you note.