When I put our new dryer in I marked the hole's location on the inside wall and drilled to the outside, set the dryer in place and stuck the metal pipe in from the outside wall and onto the dryer. Of course, if the dryer is backing up to a basement wall and the vent comes out some other place that big idea will not work.
If that is the case you can use "wall stack" metal duct. It measures 3" X 10" and you will need enough to run just past the vent on the dryer and a couple of inches or so past the opening to the outside (it comes in 2' lengths so it should work out somewhere near the locations. Cap both ends, cut a 4" hole near one end to slide onto the dryer and another 4" hole on the back side of the duct at the vent opening in your wall, run a piece of 4" pipe into the duct there but don't protude into the duct (make cuts around that end of the pipe 1/2" deep and 1/2" apart), bend some of the tabs out, stick the rest of them into the duct, reach through the pipe and bend the others out inside the duct to lock it in place. This will allow you to place the dryer only 3" from the back wall; hope that is enough.
Glenn