We present a new approach to the computation of an electrical field propagating in a dielectric structure. We use the Green's-function technique to compute an exact solution of the wave equation. No paraxial approximation is made, and our method can handle any kind of dielectric medium (air, semiconductor, metal, etc.). An original iterative numerical scheme based on the parallel use of Lippman-Schwinger and Dyson's equations is demonstrated. The influence of the numerical parameters on the accuracy of the results is studied in detail, and the high precision and stability of the method are assessed. Examples for one and two dimensions establish the versatility of the method and its ability to handle structures of arbitrary shape. The application of the method to the computation of eigenmode spectra for dielectric structures is illustrated.