Fix sending emails from CLI