NEC 250.140 Frames of Ranges and Clothes Dryers.
The Exception to 250.140 permits an existing branch circuit without a grounding conductor to be used for a Range or Clothes Dryer if all of the following conditions are met. (edited for your described condition)
(1) A 120/240 Volt single phase circuit
(2) Grounded conductor (neutral) at least #10
(3) Neutral is insulated; or if it is not insulated then it is part of a Type SE Cable and the branch circuit originates at the service equipment (not a sub-panel).
(4) Grounding contacts of receptacles furnished as part of the equipment (such as an outlet on the control panel of a range) are bonded to the equipment.
If the dryer has a 3-wire cord, then you can use a 3-wire receptacle.
If you are connecting a dryer that already has a 4-wire cord, then the frame of the dryer must be connected in a way that the frame is grounded. That could be done by connecting the ground in the 4-wire receptacle to the neutral terminal in the connector. If you do that, then you should put a note on the receptacle to tell future users that the grounding terminal is connected to the neutral terminal. If the connection is made internal to the dryer then you should put a note on the dryer that the frame is connected to the neutral.
You should be aware that both of these conditions result in grounding the frame of the dryer, because the neutral, also called the "grounded conductor", is in fact grounded. The conductor that is absent from your circuit is called the "equipment grounding conductor" and has been used in only recently (I don't know how recently) installed dryer and range circuits.