My friend told me not to use the above sentence while writing a letter. According to him we should use "how have you been?" when we meet someone. But when we write a letter, we should use something else like "How are you?" etc etc. Is he right?
I agree with haogide's answer.

"How are you?" is a very popular expression. "How have you been?" is not as popular.

How are you? - 1.5 million hits on Google

How have you been? - 52 thousand hits on Google.

I don't think most people even think about it. They just simply use whichever expression they want.
I think that's just a matter of personal opinion, really. "How are you?", in my opinion, is just about the same as "How have you been?" The difference is that "How have you been?" sounds a little more like you're expecting an immediate answer, as in a conversation. I personally wouldn't think any less of anybody if they asked me "How have you been?" in a letter. I would see it as the same question as "How are you?"...

I hope that helps.
Students: We have free audio pronunciation exercises.
 MountainHiker's reply was promoted to an answer.
Thank you Haogide and MountainHiker for your help. I was thinking the same reason.
Our pleasure meg2589.
Teachers: We supply a list of EFL job vacancies