A search for the lepton-flavour violating decays $B^0_s rightarrow e^pm mu^mp$ and $B^0 rightarrow e^pm mu^mp$ is performed based on a sample of proton-proton collision data corresponding to an integrated luminosity of 3 fb$^{-1}$, collected with the LHCb experiment at centre-of-mass energies of 7 and 8 TeV. The observed yields are consistent with the background-only hypothesis. Upper limits on the branching fractions are determined to be $mathcal{B}(B^0_s rightarrow e^pm mu^mp) < 5.4,(6.3) times 10^{-9}$ and $mathcal{B}(B^0 rightarrow e^pm mu^mp) < 1.0,(1.3) times 10^{-9}$ at $90%,(95%)$ confidence level, which are the strongest limits on these decays to date.