Hi [Recipient’s name],
I hope that you are well. I want to say that I am genuinely and profoundly sorry for the messages that I sent to you over the last few years. As you might know I was going through a difficult time but that is absolutely no excuse for my behaviour, those messages are now very much a matter of regret especially as your very kind advice was extremely useful to me.
Please accept both my heartfelt apologies and thanks.
All the best,
[My name]