VCC is 5V , so yes, the fan will switch on, no code required and the fan will draw as much power as the batteries can supply.
in order to control the fan however, you’ll need to use logic pins to switch the power on and off to the fan and the way you do that is by using a motor driver (or simply a transistor)
What OutOfTheBots said was right - if you try to supply the fan with power from S1 or S2 (the signals from the pins connected to the RJ25), you risk damaging the processor. He mentioned Back EMF - When a motor rotates in the reverse direction, stops or slows down abruptly, a current flow back to the motor’s power supply (the digital pin of the processor in this case), this in essence kill the pin completely. Always, always, always, protect your CPU!
The pins of the CPU are not designed to supply current to drive motors, they’re designed for logic, not power.
When hooking up motors to a you need to use a transistor or H-bridge which allows you to use the digital pin as an on-off switch. (an H bridge is an electronic circuit that can drive the motor in both directions - it’s called an H bridge because it is basically just four transistors, and the circuit looks like the letter H).
The function of a transistor is to permit the current to flow from VCC to ground, through the motor when a digital pin is high (5v), or stop current flowing when a digital pin is low (0v)
https://www.makeblock.com/project/me-dual-motor-driver <- this is a proper motor driver. (you’ll see from the description it has an H bridge).
Have a look here: http://www.thebox.myzen.co.uk/Workshop/Motors_1.html for more information
We’re just trying to make sure you don’t make any expensive mistakes, and it’s always worth learning a little bit about the electronics as you go