The Tolman-Bondi solution of the Einstein equations is used to study the microwave background anisotropy produced by a pressureless spherical cosmological inhomogeneity. Our method improves on previous ones because it does not involve any approximating condition and it allows us to assume the following: (1) a general Friedmann-Robertson-Walker background, (2) an arbitrary relative location of the observer and the inhomogeneity, (3) either an overdense or an underdense inhomogeneity with arbitrary size, (4) an arbitrary initial energy density profile, and (5) an arbitrary amplitude of the density contrast. This general method is applied to compute the anisotropy produced by some nonlinear uncompensated density distributions, which mimic nearby voids. For void models having the same present energy profile, the nondipolar anisotropy depends on the density parameter OMEGA, it is found that, for OMEGA values of approximately 0.4-0.5, this anisotropy becomes 4 times larger than the nondipolar anisotropy of the case OMEGA = 1. In order to test our nonlinear computation scheme, it is applied to a selected linear case. This case is also studied with an alternative linear computation scheme based on the Tolman-Bondi solution. Both schemes lead to compatible results.