David Moyes’ side will be at home in the first leg.
West Ham will face either Danish club Viborg FF or B36 Torshavn of the Faroe Islands in the play-off qualifying round for a place in the Europa Conference League.
David Moyes’ side will be home in the first leg on August 18 and face a trip to either Denmark or the Faroes for the second leg seven days later.
Viborg and B36 face each other over two legs this Wednesday, with the winner taking on the Hammers.
Should they triumph over the two-legged play-off, West Ham would qualify for the group stage, which will be drawn on Friday, August 26 and begin on September 8.
West Ham, who reached the semi-finals of the Europa League last season, qualified for Europe’s third-tier competition by finishing seventh in the Premier League.