It is shown that by switching a specific time-dependent interaction between a harmonic oscillator and a transmission line (a waveguide, an optical fiber, etc.) the quantum state of the oscillator can be transferred into that of another oscillator coupled to the distant other end of the line, with a fidelity that is independent of the initial state of both oscillators. For a transfer time $T$, the fidelity approaches 1 exponentially in $gamma T$ where $gamma$ is a characteristic damping rate. Hence, a good fidelity is achieved even for a transfer time of a few damping times. Some implementations are discussed.