title: Malformed HTML while sending CLOB as body to UTL_SMTP
body: <p>I have a requirement to send an Email from an Oracle database.
  This will be rather long with a table contains more than 1k rows.</p>
  
  <p>The basic Pl/SQL code is as follows -</p>
  
  <pre><code>PIVARHTMLMSG   CLOB;
  LNUMSTART NUMBER := 1;
  LNUMCHUNK NUMBER := 1900;
  I NUMBER := 0;
  
  PIVARHTMLMSG := '&lt;HTML&gt;&lt;BODY&gt;&lt;P&gt;Some Heading&lt;/P&gt;&lt;TABLE BORDER="1"&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;NAME&lt;/TD&gt;&lt;TD&gt;EMAIL&lt;/TD&gt;&lt;/TR&gt;';
  
  WHILE (TRUE)
  LOOP
      PIVARHTMLMSG := PIVARHTMLMSG || '&lt;TR&gt;&lt;TD&gt;999999&lt;/TD&gt;&lt;TD&gt;TEST TEST TEST&lt;/TD&gt;&lt;TD&gt;TEST.TEST@TEST.COM&lt;/TD&gt;&lt;/TR&gt;';
      I := I + 1;
      IF I &gt; 1000 THEN
          EXIT;
      END IF;        
  END LOOP;
  
  WHILE LNUMSTART &lt; NVL(DBMS_LOB.GETLENGTH(PIVARHTMLMSG), 0) LOOP
      UTL_SMTP.WRITE_DATA(lMailConn,DBMS_LOB.SUBSTR(PIVARHTMLMSG,LNUMCHUNK,LNUMSTART));
      LNUMSTART := LNUMSTART + LNUMCHUNK;  
      LNUMCHUNK := LEAST(LNUMCHUNK,DBMS_LOB.GETLENGTH(PIVARHTMLMSG) -LNUMCHUNK);
  END LOOP;
  </code></pre>
  
  <p>The email is rendered as follows -</p>
  
  <p><a href="https://i.stack.imgur.com/y8Ier.png" rel="nofollow"><img src="https://i.stack.imgur.com/y8Ier.png" alt="enter image description here"></a></p>
  
  <p>What could be possible reason for such a behavior ?</p>