corrected smtp function.