Saying "I have written to him," only suggests that at some point in the past you wrote one or more letters to him. It does not mean that you no longer write him. It conveys no information regarding present or future correspondence with him and very little information on the past correspondence, merely indicating that it occurred to some unspecified extent.
As a general rule if you are going to use specific time frames, years for example, use present perfect continuous.
I have been writing to him for six years but I recently stopped [writing to him].
You may use the present perfect with more generalized time frames.
I have written to him many times but will no longer [write to him].
Both are correct and will be understood.
I have written to him for a long time/six years.
implies that you are still writing to him, unless you say otherwise.
You can use the present perfect continuous/progressive to indicate that you recently stopped writing him:
I have been writing to him for a long time/six years.
But this is ambiguous, because it could also mean you are still writing him. So, to get your meaning across, you need to depend on context or state explicitly that you are no longer writing him:
I have been writing to him for a long time/six years. But that's long enough. Someone else can write to him from now on.
There is no difference in grammar between for a long time and for six years.
You want to say that in the past you formed an intention to call Jane, and that intention has persisted into the present because it has never been fulfilled. Look at your options for expressing this:
SIMPLE FORMS
I mean to call Jane.
This form describes your present intention. It says nothing about the past.I meant to call Jane.
This form describes a completed past intention—the technical term is perfective, which is quite different from "perfect" constructions. It implies that the intention was either fulfilled or dropped. It says nothing about the present.
PROGRESSIVE FORMS
✲I am meaning to call Jane.
✲I was meaning to call Jane.
These forms are prohibited in ordinary use, because mean to is a stative verb like know, have, live, and these verbs have the progressive sense "built in". The prohibition is weaker in the past form, which may be employed to specifically exclude the perfective sense: I was meaning to call Jane, but kept forgetting. You'll occasionally find this in colloquial use instead of the perfect progressive: I was meaning to call you.
PERFECT FORMS
I have meant to call Jane.
I had meant to call Jane.
These forms describe an intention held before a present (have) or past (had) Reference Time (RT) which led to some sort of a state which obtains at RT. With mean to it is ordinarily used to cast light on a current situation by pointing to past intention, so it tends to be restricted to formal "forensic" discourse: I have meant to assail the motives of no party, or individual; and if I have, in any instance (of which I am not conscious), departed from my purpose, I regret it. — A. Lincoln. You could use this in the present context, but the intention would be seen retrospectively, and the second clause should be recast to suit it: "I have meant to call Jane, but have repeatedly forgotten to." It would neither imply nor exclude the persistence of your intention into the present.
PERFECT PROGRESSIVE FORMS
I have been meaning to call Jane.
I had been meaning to call Jane.
These are the forms ordinarily employed in both formal and informal registers to express an intention formed before the (present or past) RT and persisting into RT. The perfect piece of the construction (have/had) expresses the existence of the intention before RT, and the progressive piece (BE -ing) expresses persistence, excluding perfectivity.
Incidentally, mean to (as opposed to bare mean) is one of a class of verbs which act as semi-auxiliaries—the to means that they take a to-infinitive.
get to
happen to
have to
seem to
tend to
turn out to
used to
be about to
be going to
be likely to
be supposed to
Each of these follows its own set of 'rules', depending on its semantic character.
First, you are correct; in this context, 'meaning' means 'intending'.
As for the tense, we use that tense when we have been wanting to phone Jane for some time now (that's important – I've been meaning to do something implies my intent has persisted for some length of time). Furthermore, it also implies that I still haven't called her. (If I had phoned Jane already, then the verb tenses would change: I had been meaning to phone Jane, but I kept forgetting. That implies that I eventually overcame my forgetfulness and made the phone call.)