You're attaching the file $value and putting it in the body of your mail. Doesn't either one of the 2 suffice?
#as attachment only
echo "" | nail -s test -a $value firstname.lastname@example.org
#as mail body only
nail -s test email@example.com < $value
Just to explain what goes on here...
nail normally expects your keyboard input on its "stdin" (standard input). Using either a pipe "|" or the input
redirect "<", you can make the input come from a command or a file respectively, rather than the keyboard device.
The Ctrl-D (EOT) character on the keyboard is used to end the input, closing of the standard input that is read by nail.
The pipe and redirection will automatically close the standard input too, once they reach the end of the command's output (in case of pipe) or the end of the input file (in case of redirection).