The Ruderman-Kittel-Kasuya-Yosida (RKKY) interaction is considered when the contact potential is replaced by an arbitrary distribution instead of the conventional Dirac's $\ensuremath{\delta}$ function. The appropriate formulas for the RKKY exchange integrals, in the case of one-dimensional, two-dimensional, and three-dimensional systems, are derived. In order to exemplify the modification, the three distributions are used for numerical calculations of the interaction vs spin-spin distance, namely: Gaussian, uniform, and exponential. One of the results shows that ``diffusion'' of the contact potential removes an unphysical divergency of the RKKY integral at zero distance and the finite value obtained depends strongly on the distribution width.