Use 에게 with the nouns that have a feeling/emotion, such as animals, people, etc.
Use 에 with the nouns that doesn't have a feeling/emotion, such as materials, products, buildings, etc.
나는 학교-에 갔다. (not 학교-에게)
However, if you personfy 학교 as a human being in your poem, you could use the particle '-에게' with it.