Fixed smtp test function