Is it possible to use a custom function or deluge scripting to export and email?

Is it possible to use a custom function or deluge scripting to export and email?

Example:

I have a stateless form that the user enters their email address, a start date and and end date.  I want them to be able to select the custom button and it send the email address entered a selection of records from a form based on the date range selected?  

Is this possible?