A procedure to obtain the dynamics of $N$ independent qudits ($d$-level systems) each interacting with its own reservoir, for any arbitrary initial state, is presented. This is then applied to study the dynamics of the entanglement of two qubits, initially in an extended Werner-like mixed state with each of them in a zero temperature non-Markovian environment. The dependence of the entanglement dynamics on the purity and degree of entanglement of the initial states and on the amount of non-Markovianity is also given. This extends the previous work about non-Markovian effects on the two-qubit entanglement dynamics for initial Bell-like states [B. Bellomo textit{et al.}, Phys. Rev. Lett. textbf{99}, 160502 (2007)]. The effect of temperature on the two-qubit entanglement dynamics in a Markovian environment is finally obtained.