This is a polite phrase that you say or write to people you don't know very well, who you meet in a work situation or other formal situation. You usually use this at the end of your conversation with someone, or a few days later when you contact them again. Here are other examples:
It was great talking to you yesterday.
It was great seeing you! Bye!
Note that people also often say "It was great to meet you the other day." The differences between these are pretty small.