Spin-dependent electronic transport through carbon nanotubes (CNTs) was studied, either sandwiched between ferromagnetic contacts or in external magnetic fields. Attention was paid to the conductance dependence on geometrical size (the length and diameter) of the CNTs, chirality, and conditions at CNT/contact interface. The CNTs are end-contacted to fcc (111) metallic leads, and the relative atomic positions at the interfaces are determined by the relaxation procedure. Additionally, a charge neutrality condition is imposed on the extended molecule (i.e., CNT with a few atomic layers of the leads) in order to fix the band line-up of the whole system. Using a single-band tight-binding model and a Green's function technique, it is shown that if the electrodes are ferromagnetic, quite a considerable giant magnetoresistance effect can occur. For paramagnetic electrodes in a parallel magnetic field, clear Aharonov-Bohm oscillations are observed, with distinct minima in the conductance. The depth of the dips depends on the diameters of the CNTs, most likely due to some unintentional doping from the contacts. In the case of perpendicular geometry, pronounced conductance oscillations appear whenever the magnetic length becomes smaller than the perimeter of a CNT.