In this study, an attempt has been made to investigate the mass and heat transfer effects in a BLF through a porous medium of an electrically conducting viscoelastic fluid subject to a transverse magnetic field in the existence of an external electric field, heat source/sink, and chemical reaction. It has been considered the effects of the electric field, viscous and Joule dissipations, radiation, and internal heat generation/absorption. Closed-form solutions for the boundary layer equations of viscoelastic, second-grade, and Walters’
B
′
fluid models are considered. The method of the solution includes similarity transformation. The converted equations of thermal and mass transport are calculated using the optimal homotopy asymptotic method (OHAM). The solutions of the temperature field for both prescribed surface temperature (PST) and prescribed surface heat flux (PHF) are found. It is vital to remark that the interaction of the magnetic field is found to be counterproductive in enhancing velocity and concentration distribution, whereas the presence of chemical reaction, as well as a porous matrix with moderate values of the magnetic parameter, reduces the temperature and concentration fields at all points of the flow domain.