script help

i have a script i am wiriting for my team, and I want it to send an email with attachment when it is done to whoever ran the script.

i already caught the user name and email with

whoami | read WHO
EMAIL="$WHO"@domain.com

but now I want to dynamicly create a file to attach to the mail, basically I just want to list variables in the file like below
variable 1 name: $1
variable 2 name: $2

How can I write that file and then send it out using mailx?

Thanks,
Zelp

do you need an attachment OR the in-line would do?

for the latter:
mailx -s 'My Subject" "$EMAIL" < myFile

Or you can do it with the here-doc:
mailx -s 'My Subject" "$EMAIL" <<EOF
variable 1 name: $1
variable 2 name: $2
.
EOF

also look into FAQ

Thanks vgersh99

that gets parts of what I want, and I browsed through the FAQ and tried a few diff things, but can't seem to find what I want.

You see I want to write my variables to a file.

then I want to attach that file and other files to an email and send it.

can you be anymore help?

man uuencode to send an attachment.