Spin effects in transport through single-molecule magnets in the sequential and cotunneling regimes