The thermomagnetic convection of air in a porous cubic enclosure with an electric coil inclined in general orientations was numerically investigated under microgravity environment. Biot-Savart's was used to calculate magnetic field. The governing equations in primitive variables were discretized by the finite-volume method and solved by the SIMPLE algorithm. The Darcy model was used to solve the momentum equations. The results show that both the magnetic force and the coil inclination have significant effect on the flow field and heat transfer in a porous cubic enclosure; the natural convection heat transfer of air can be enhanced or controlled by applying gradient magnetic field.