adjusted logic in smtp file