Try enclosing subject with double quotes
a="John Foo";echo|mutt -s "welcome $a" -e 'my_hdr From:info@example.com <info@example.com>' test@example.com
It will send a mail with subject welcome John Foo
. Change your command for required subject. You are free put spaces anywhere in subject or variable value now.
Note: It's standard practice to specify any input, variable for command line arguments to linux commands with proper quotes to mitigate white space issues.
''
for literal string
""
for variable substitutions