This is a difficult area of English for foreign learners, and I’m afraid you’re not going to understand it fully from a few answers here. Very briefly, you use the present perfect continuous form to talk about events in the recent past, particularly activities that have not been completed. The form is often found with the prepositions ‘for’ and ‘since’, as in ‘He’s been speaking for a very long time’ or ‘I’ve been working non-stop since this morning’.
Here are a few examples contrasting the present perfect with the present perfect continuous:
'I’ve done my homework' (it’s finished) / 'I’ve been doing my homework' (it’s not finished)
‘I’ve drunk my coffee' (it’s all gone) / ‘I’ve been drinking my coffee’ (there’s some left)
‘It’s rained every day since the weekend’ (repeated rain) / ‘It’s been raining all day’ (continuous rain)
Your own examples don’t really illustrate the use very well. You wouldn’t say ‘I have learned English language in the past few weeks’, because that suggests you’ve finished your studies and you don’t need to do any more. That’s unrealistic. No one learns English in a few weeks. I think these two examples might show the difference more clearly:
‘I have been studying English for two years’ (I’m still studying it)
'I have studied English, but I don’t speak it very well' (I studied it at some time in the past, but am not studying it any more)
... you can't present perfect (or continuous) and past simple within a sentence.
As it stands, this rule is incorrect. In many cases it is acceptable and logical to mix past and present references in consecutive clauses
I lost my keys last week, but now I have found them.
This makes sense: A was true then, but B is true now.
This, however, does not make sense:
He has decided to go hiking, so I went hiking as well.
This sentence amounts to A was true then, because B is true now. The simple past describes a past event, your going hiking, but what the present perfect describes is not a past event, his decision, but a present state which is the result of a past event--his state of having decided. That present state cannot be the cause of the past event. The cause must be either a past event or a past state:
He decided (event) to go hiking, so I went hiking as well or
He had decided (state) to go hiking, so I went hiking as well.
The important thing is not to mix time references illogically.
As for the sentence in your friend's email:
Getting that email was such a pleasant surprise, because I was just thinking how I've been wanting to send you an email
There is no mixture of time references here, because the progressive construction "I have been wanting" marks a state, not an event, which may very reasonably be taken to continue into the present out of a past which is marked (by "just") as immediate. In effect, these pasts inhabit the same time frame as the present.
In any case, the "rules" are very loosely applied in informal discourse; see my discussion here. A casual email, which your friend probably dashed off in excitement, should not be held to the formal literary standards of coherence.
Best Answer
More idioms.
"I have been to somewhere" means that I have gone there and come back. But you can only use this in the perfect (present, past or even future): it isn't available in any other tense:
but not:
The special meaning relates to the word 'been', not any other parts of 'to be'.
In most uses, "go" is unspecific about whether or not there is a return journey:
is probably a trip, but could be emigration.
The case of "gone" brings in the special properties of the perfect. "He has gone" is talking about a state of affairs that includes, or relates to, the present. The most obvious interpretation of
is that he is still going, or still there. But as Robusto says the present-relevance could have a different interpretation, so
necessarily means that he must have returned (or gone somewhere else), so the present relevance is that the sequence of trips is seen as continuing. Contrast
which implies that the series of trips is over, and he is not going again.
(These are implications, and may be overridden by other words or by context; but in the absence of anything to the contrary, the sentences will have the meanings I am suggesting.)