Molecular dynamics simulation of electron-transfer reactions in solution