Send an email with sql code