I would contact T-Mobile and they should be able to provide you the unlock code -- especially if the phone is fully paid off.
I talked to a tech rep at T-Mobile just now and they won't deal with me because I don't have a T-Mo account... Doesn't surprise me, but it was a good suggestion. Anyway, I do have unlock codes (purchased) for it now, I just can't enter them!
Method #1 Go to the dial screen and press “2945#*model number#”
for example if its a p999 you enter “2945#*999#” or if its a p990 you enter “2945#*990#” etc…
[so that's 851 for my T-Mobile phone.]
Method #2 to the dial screen and press 2945#*71001# as if making a call, enter code when prompted
Method #3 Go to the dial screen and press *#865625# as if making a call, enter code when prompted