I have a written a script which sents the output in html format and displays it in the foreground. But for some reason it is displaying in raw html format in outlook 2013. What could be the reason. I am pasting the script as below:-
[dba@server_1 scripts]$ cat script.sh
#!/bin/bash
. /home/dba/.bash_profile
cd /u01/session
rm created_objects.html
for DB in database_1
do
export ORACLE_SID=$DB
export ORACLE_HOME=`grep $DB /etc/oratab | awk -F ":" {'print$2'}`
$ORACLE_HOME/bin/sqlplus -s "/ as sysdba" << EOF
set markup html on spool on
spool /u01/session/created_objects.html
set linesize 200
col machine for a45
col username for a15
col program for a35
set feedback off
set head on
SELECT count(1) AS connection_count, machine, username, osuser, program
FROM v\$session
WHERE type <> 'BACKGROUND'
GROUP BY username, machine, osuser, program
ORDER BY connection_count DESC;
spool off;
EOF
done
echo >> created_objects.html
mail -s "$(echo -e "Newly Created Objects\nContent-Type: text/html")" email@mail.com < /u01/session/created_objects.html
You don't say what system you are using. If you are using Linux I suggest you look at using mailx . The Gnu version should include MIME support and may be able to work with few modifications to your script.
You say that Outlook is displaying raw html. What about other clients?
Web based email can't really avoid showing text as HTML. What else is an HTML parser going to do when HTML is jammed into it by whatever means?
I suspect jamming 'content type' into the subject doesn't actually create a valid content-type header. Assembling a valid email and giving it to your mail daemon raw is better for picky things.