West Ham will face Romanian side Astra Giurgiu in the Europa League play-off round.
The Hammers were knocked out of the competition by the same team in the third qualifying round last season.
Slaven Bilic’s men progressed to this round with a 4-2 aggregate win over Slovenian side NK Domzale.
The Premier League side travel to Romania for the first leg on 18 August before hosting the return leg at their new London Stadium on 25 August.
The draw means both English teams in European play-off ties face Romanian sides, with Manchester City drawn with Steaua Bucharest in the Champions League.