verb
1
BAD : I'd like to apologize for not having written you before.
GOOD : I'd like to apologize for not having written to you before.
◆◆◆
In British English you write to a person or place (WITH to ): 'Wingate wrote to his father, asking for more money.'
In American English to is optional: 'I'll write (to) you and give you all the latest news.'
2
BAD : Dear ... I write to you to ask for your advice.
GOOD : Dear ... I am writing to you to ask for your advice.
◆◆◆
For actions which are happening at the time when they are mentioned, use the present progressive tense (NOT the present simple): 'I'm writing to tell you that I'll be coming to London next Thursday.'