It is quite obvious to realize that the cork can be shooted out by high pressure generated inside the bottle. Actually, when the bottle is heated, the air inside it also gets heated, the molecules of the air gain high kinetic energy so the gas try to expand. As a result, it exerts pressure on the stopper and forces it to shoot out of the bottle.