We report the first results on a direct search for a new 16.7 MeV boson (X) which could explain the anomalous excess of e^{+}e^{-} pairs observed in the excited ^{8}Be^{*} nucleus decays. Because of its coupling to electrons, the X could be produced in the bremsstrahlung reaction e^{-}Z→e^{-}ZX by a 100 GeV e^{-} beam incident on an active target in the NA64 experiment at the CERN Super Proton Synchrotron and observed through the subsequent decay into a e^{+}e^{-} pair. With 5.4×10^{10} electrons on target, no evidence for such decays was found, allowing us to set first limits on the X-e^{-} coupling in the range 1.3×10^{-4}≲ε_{e}≲4.2×10^{-4} excluding part of the allowed parameter space. We also set new bounds on the mixing strength of photons with dark photons (A^{'}) from nonobservation of the decay A^{'}→e^{+}e^{-} of the bremsstrahlung A^{'} with a mass ≲23 MeV.