Hi!
I don't think there is any harm in writing a 'thank you' letter. We all know that there are different forms of communication. Written communication remains permanent in record and is deemed to be an official communication. Whereas, verbal communication is a temporary nature of communication which over the period loses its value and also get vanished with the exit of the 'Boss'/concerned officials. Further, written communication sometimes are more effective, if worded correctly, suitably and nicely.
However, I suggest the following contents:
Sir, at the outset, I am thankful to you for keeping faith in me and giving a chance to serve your esteemed Company. I have just completed three years of my working in the company and feel proud to be a member of the group.
Sir, the kind of opportunities I have been provided, I find myself professionally a better equipped person now. The guidance under your supervision has helped to convert myself into a different version of me whether it's on personal or professional front.
This Company has made all my professional ambition fulfilled. I am in fact contended to a greater extent in terms of everything.
Sir, I take this opportunity to sincerely express my gratitude to you and the company for all your help, support, cooperation and guidance to me. At the same time, I assure you for my best services at all times.
Thank you,
Sincere Regards,