Studying the effect of functional groups on the porosity structure and adsorption efficiency of polymer materials is becoming increasingly interesting. In this work, a novel porous polyaminal-linked polymer, based on naphthalene and melamine (PAN-NA) building blocks, was successfully synthesized by a one-pot polycondensation method, and used as an adsorbent for both CO2 and heavy metals. Fourier transform infrared spectroscopy, solid-state 13 C NMR, powder X-ray diffraction, and thermogravimetry were used to characterize the prepared polymer. The porous material structure was established by field-emission scanning electron microscope and N2 adsorption–desorption methods at 77 K. The polymer exhibited excellent uptake of CO2, 133 mg/g at 273 K and 1 bar. In addition, the adsorption behavior of PAN-NA for different metal cations, including Pb(II), Cr(III), Cu(II), Cd(II), Ni(II), and Ba(II), was investigated; a significant adsorption selectivity toward the Pb(II) cation was detected. The influence of pH, adsorbent dose, initial concentrations, and contact time was also assessed. Our results prove that the introduction of naphthalene in the polymer network improves the porosity and, thus, CO2 adsorption, as well as the adsorption of heavy metals.