Need a transistor to drive 12v 400mA Solenoid
With a distinct lack of detail, I shall prescribe this component:

http://www.digikey.com.au/product-detail/en/MMBT123S-7-F/MMBT123S-FDICT-ND/815722

This is a surface mount NPN transistor. It has a beta value of 140-150, at 400ma load. Your 3ma max will drive 400ma through it. It will dissipate ~100mW through it during this time, but it is rated to 300mW.

do NOT put >5V into it's base pin. The max Collect-Emitter voltage is 18V, so respect that too. 

dont forget a simple barrier/rectifier diode (1N4001 or whatever) parallel to your solonoid