Using the data samples of (1310.6±7.2)×106 J/ψ events and (448.1±2.9)×106 ψ(3686) events collected with the BESIII detector, we search for the rare decays J/ψ→D0e+e-+c.c. and ψ(3686)→D0e+e-+c.c. No significant signals are observed and the corresponding upper limits on the branching fractions at the 90% confidence level are determined to be B(J/ψ→D0e+e-+c.c.)<8.5×10-8 and B(ψ(3686)→D0e+e-+c.c.)<1.4×10-7, respectively. Our limit on B(J/ψ→D0e+e-+c.c.) is more stringent by 2 orders of magnitude than the previous results, and B(ψ(3686)→D0e+e-+c.c.) is measured for the first time.