To send the output of a command as an attachment via email:
cmd | uuencode attachment-filename | mailx -s "subject" person@domain.com
This could be a csv that gets generated, a file from your hard drive, or something else interesting that needs to be opened with a program to be meaningful. Normal command output is easier to view as inline text.
Sending the output of a command as inline text:
cmd | mailx -s "subject" person@domain.com