In oxidizing environments, most tin-based lead (Pb)-free alloys form a tin oxide that is easily eroded or mechanically damaged, affecting corrosion resistance and thus reliability of the soldered joints. In this study, the effect of microstructure heterogeneity on corrosion behavior of Pb-free solder candidate systems has been investigated on the example of as-cast and heat-treated alloys. The research was focused on a comparison between the corrosion resistance of binary Sn-Zn and ternary Sn-Zn-Cu alloys. Accelerated corrosion tests were performed by means of electrochemical methods in the sodium sulfate solution (VI), Na2SO4, of about 0.5 M concentration, pH adjusted to 2 by means of concentrated H2SO4 acid. In these tests, the corrosion potentials as well as polarization curves were determined for the selected alloys in as-cast state and after their heat treatment using different combinations of processing parameters. The measurements of basic electrochemical characteristics were made, i.e., the corrosion current (i corr μA/cm2) and Tafel coefficients, both cathodic (b c V/dec) and anodic (b a V/dec) ones. Detailed structural characterization of as-cast and heat-treated alloys before and after accelerated corrosion tests has been made under a wide range of magnifications using light microscopy and scanning electron microscopy observations. The results showed that structural heterogeneity of the examined alloys, attributed to the presence of secondary phases, and affected by their size and distribution, significantly influences the behavior of the examined Pb-free Sn-Zn-based alloys in the corrosive environment.