added session_start where needed. and changed smtp validation