If you can give me the reference of what you have and also the Amp rating of your fan, I can check if it will work and which resistor we need...
You probably need a flyback diode as well (1N400x or whatever) unless the transistor has one builtin.