Crown prosecutor Amelia Jeffares said they had been in an on-off relationship for six years when the woman moved out in 2017.
She had asked him not to contact her but began to receive emails from him after a couple of weeks.
The woman, who has name suppression, said it was typical of him to continue to email her even though he knew she did not want the contact.
She told the Wellington District Court jury on Monday that he would even deposit money into her bank account, so he could leave a message on her statement saying he loved her or missed her.