In this work, we investigate the masses of a few heavy–light mesons with variational method, taking into account the two-loop effects in the static Cornell potential. Specifically, we consider two wave functions, Gaussian and Coulomb. Our analysis suggests that phenomenologically such approach is more successful in the heavy flavored meson sector than the stationary state perturbation theory and other approximation methods.