problem with sending mail from txt file having HTML code via sendmail -t

Hi,

i have the following code in shell named as test3.sh..

#!/bin/sh
. /home/<user>/.profile
export dt=`date "+%d%b%y"`
export tim=`date "+%d%b%y %HM:%MM"`

cd
export WD=`pwd`
SID="<sid>"
export SID

export ORACLE_SID=$SID
export ORACLE_HOME=/oracle/$SID/102_64
export PATH=$ORACLE_HOME/bin:/oracle/$SID:/usr/sap/$SID/SYS/exe/run:$PATH
export SAPDATA_HOME=/oracle/$SID
MAILFILE=/tmp/Total_user.mailfile.12648584.txt
/bin/cat ${MAILFILE} | /usr/lib/sendmail -t

and my file 'Total_user.mailfile.12648584.txt' contains the following HTML text:

Mime-Version: 1.0
Content-type: text/html; charset="iso-8859-1"
From: user@company.com
To: user@company.com
Cc: user@company.com
Subject: subject

<html>
<head>
  <title>Total</title>
  <style type=text/css>
    body {
       margin:10px 10px 0px 10px;
       padding:0px;
       font-family: verdana, arial, helvetica, sans-serif;
       font-size: 10px;
    }
    table {
       border-collapse: collapse;
       background-color:#FFF;
       font-family: verdana, arial, helvetica, sans-serif;
    }
    td {
       font-size: 10px;
       font-family: verdana, arial, helvetica, sans-serif;
       border:1px solid #006;
    }
  </style>
</head>
<body>
<FONT size=2><b>Please Find The Below</b></font>
<br><br>
<FONT face="Arial Black" color="#f87217" size=6><b>P</b></font>
<br><br>
<table width=400>
  <tr>
    <td bgcolor="#99CCFF" width=250><b>NAME</b></td>
    <td bgcolor="#99CCFF" width=250><b>TOTAL</b></td>
    <td bgcolor="#99CCFF" width=250><b>LOGON</b></td>
  </tr>
  <tr>
    <td>T</td>
    <td>27</td>
    <td>1</td>
  </tr>
  <tr>
    <td>H</td>
    <td>8</td>
    <td><font color="#FF0000">0</font></td>
  </tr>
  <tr>
    <td>U</td>
    <td>103</td>
    <td>35</td>
  </tr>
  <tr>
    <td>HU</td>
    <td>20</td>
    <td>7</td>
  </tr>
  <tr>
    <td>R</td>
    <td>57</td>
    <td>7</td>
  </tr>
  <tr>
    <td>S</td>
    <td>4</td>
    <td><font color="#FF0000">0</font></td>
  </tr>
  <tr>
    <td>K</td>
    <td>5</td>
    <td><font color="#FF0000">0</font></td>
  </tr>
  <tr>
    <td>F</td>
    <td>4</td>
    <td><font color="#FF0000">0</font></td>
  </tr>
  <tr>
    <td>R</td>
    <td>13</td>
    <td><font color="#FF0000">0</font></td>
  </tr>
  <tr>
    <td>FR</td>
    <td>2</td>
    <td><font color="#FF0000">0</font></td>
  </tr>
  <tr>
    <td>FR1</td>
    <td><font color="#FF0000">0</font></td>
    <td><font color="#FF0000">0</font></td>
  </tr>
  <tr>
    <td>FR2</td>
    <td>14</td>
    <td><font color="#FF0000">0</font></td>
  </tr>
  <tr>
    <td>R07</td>
    <td>226</td>
    <td>99</td>
  </tr>
  <tr>
    <td>R8</td>
    <td>1</td>
    <td><font color="#FF0000">0</font></td>
  </tr>
  <tr>
    <td>A2</td>
    <td>43</td>
    <td>12</td>
  </tr>
  <tr>
    <td>Sq</td>
    <td>318</td>
    <td>13</td>
  </tr>
  <tr>
    <td>Pw</td>
    <td>234</td>
    <td>2</td>
  </tr>
  <tr>
    <td bgcolor="#4AA02C"><b>TOTAL</b></td>
    <td bgcolor="#4AA02C"><b>1079</b></td>
    <td bgcolor="#4AA02C"><b>176</b></td>
  </tr>
</table>
<br><br>
<font size=1>
This is an automatically generated email. Please donot reply. For more info, please contact<br>
 at <a href="mailto: user@company.com">user@company.com</a>.
</font>
<br><br><br>
</body>
</html>

when i run through command as 'sh test3.sh' it executes perfectly and send me the mail..
But when i schedule it in crontab, in cron log it is showing successful but no mail has been sent to me. it send mail to unix id as 'You have mail in /usr/spool/mail/root'.

i schedule in cron as follows:

17 09 * * * /oracle/<sid>/scripts/test3.sh

Kindly let me know anything more required and why it not sending mail to user@company.com

its urgent..thank you in advance

Did you put it in the crontab of the same user as you run the script manually with?

i am new to unix...can you please elaborate...
i schudule as root..
on command line i use ora<sid>
what to do for scheduling in same user as orasid???

If you run the script with user 'ora', you should put the cron entry in the crontab file of that user, not root.

You probably used 'sudo crontab -e' to edit the crontab file. Instead run it without using sudo.

it works....
thanks a lot....
i schedule it with ora<sid> and it worked...