Dilepton production from both pion-pion and kaon-antikaon annihilation in heavy-ion collisions is studied using the relativistic transport model. The formation of a rho meson from pion-pion annihilation and a phi meson from kaon-antikaon annihilation, their propagation in the medium, and their decay into dileptons are explicitly treated. Including the medium modifications of the masses and widt...