Making the send_email function configurable