The dilepton emission in heavy-ion reactions at low beam energies is examined within a hadronic transport approach. In this article, the production of electron-positron pairs from a new approach named SMASH (Simulating Many Accelerated Strongly-interacting Hadrons) is introduced. The dilepton emission below the hadronic invariant mass threshold is taken into account for all direct vector meson decays. The calculations are systematically confronted with HADES data in the kinetic-energy range of 1 − 3.5A GeV for elementary, proton-nucleus and nucleus-nucleus reactions. The present approach employing a resonance treatment based on vacuum properties is validated by an excellent agreement with experimental data up to system sizes of carbon-carbon collisions. After establishing this well-understood baseline in elementary and small systems, medium effects are investigated with a coarse-graining approach based on the same hadronic evolution. The effect of in-medium modifications to the vector meson spectral functions is important for dilepton invariant mass spectra in ArKCl and larger systems, even though the transport approach with vacuum properties reveals similar features due the coupling to baryonic resonances and the intrinsically included collisional broadening. This article provides a comprehensive comparison of our calculations with published dielectron results from the HADES collaboration. In addition, the emission of dileptons in gold-gold and pion-beam experiments, for which results are expected, is predicted.