I know this is old, but I needed a refresher and came across this. I've found it's better not to do the query in the sendmail. Export the file like this:
Execute xp_cmdshell 'SQLCMD -S VSQL2 -d urdatabase -U urname -P urpassword -Q "Select * from urfilename" -o C:\urexportedfile.csv -W -w 1500 -s","'
then just do the sendmail with an attachment- no query needed:
@profile_name = 'urSQLemailprofile',
@recipients = 'anyone@anywhere',
@subject = 'blah blah blah',
@body = 'more blah ',
If your Windows Default Programs are set for Excel to open .csv files, it will open purty as you please.
Sunnyland Farms, Inc.
"We must endeavor to persevere."