here is the html text generated and the CDOSYS is the norm with objCDOSYSMail.HTMLBody = HTML
Code:
HTML = "<html><head><style type='text/css'><!-- body {margin-left: 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 0px;} body,td,th {font-family: Arial, Helvetica, sans-serif;font-size: 12px;color: #000000;}--></style></head>"
HTML = HTML & "<body bgcolor='#ffffff' link='#999999' vlink='#999999' alink='#999999' leftmargin='0' marginheight='0' marginwidth='0' topmargin='0'><table width='580' border='0' align='center' cellpadding='0' cellspacing='0'><tr><td height='150' valign='top'><table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td><div align='right'><font color='#999999' size='2' face='Arial, Helvetica, sans-serif'>Robinson Media </font><font color='#999999' size='2' face='Arial, Helvetica, sans-serif'><br><font size='1'>Unit 5, Ashbourne Court<br>Manners Industrial Estate<br>Ilkeston<br>DERBYSHIRE<br>DE7 8EF</font><br><br>Tel: 0115 930 8333<br>Fax: 0115 944 4938</font></div></td><td width='15'> </td><td width='149'><img src='robmedia.jpg'></td></tr></table></td></tr><tr>"
HTML = HTML & "<td valign='top'><table width='5580' border='0' cellspacing='0' cellpadding='0'><tr valign='top'><td width='275'>" & (estimate.Fields.Item("CompanyName").Value) & "<br>" & replace((estimate.Fields.Item("Address").Value),",","<br>") & "<br>" & (estimate.Fields.Item("District").Value) & "<br>" & (estimate.Fields.Item("County").Value) & "<br>" & (estimate.Fields.Item("Postcode").Value) & "<br>" & (estimate.Fields.Item("Tel").Value) & "<br>" & (estimate.Fields.Item("Fax").Value) & "<br>" & (estimate.Fields.Item("EmailAdd").Value) & "</td><td><div align='right'>Estimate No. <strong> " & (estimate.Fields.Item("ENumber").Value) & "</strong><br><br>Date: " & DoDateTime((estimate.Fields.Item("EDate").Value), 1, 2057) & "</div></td></tr></table></td></tr><tr><td> </td></tr><tr><td>For the attention of " & (estimate.Fields.Item("EContact").Value)
HTML = HTML & "</td></tr><tr><td> </td></tr><tr><td>Dear " & (estimate.Fields.Item("EContact").Value) & "<br>Further to your recent enquiry, we have pleasure submitting the following estimate </td></tr><tr><td> </td></tr><tr><td><table width='580' border='0' cellspacing='0' cellpadding='0'><tr><td width='180'><strong>Title:</strong></td><td>" & (estimate.Fields.Item("ETitle").Value) & "</td></tr><tr><td> </td><td> </td></tr><tr><td><strong>Size:</strong></td><td>" & (estimate.Fields.Item("ESize").Value)
HTML = HTML & "</td></tr><tr><td> </td><td> </td></tr><tr><td><strong>Origination:</strong></td><td>" & (estimate.Fields.Item("EOrig").Value) & "</td></tr><tr><td> </td><td> </td></tr><tr><td><strong>Proofs:</strong></td><td>" & (estimate.Fields.Item("EProof").Value) & "</td></tr><tr><td> </td><td> p;</td></tr><tr><td><strong>Material:</strong></td><td>" & (estimate.Fields.Item("EMaterial").Value)
HTML = HTML & "</td></tr><tr><td> </td><td> </td></tr><tr><td><strong>Colours on side 1:</strong></td><td>" & (estimate.Fields.Item("ECS1").Value) & "</td></tr><tr><td><strong>Colours on side 2:</strong></td><td>" & (estimate.Fields.Item("ECS2").Value) & "</td></tr><tr><td> </td><td> </td></tr><tr><td><strong>Finishing:</strong></td><td>" & (estimate.Fields.Item("EFinish").Value) & "</td></tr><tr><td> </td><td> </td></tr><tr><td><strong>Delivery:</strong></td><td>" & (estimate.Fields.Item("EDelivery").Value) & "</td></tr><tr><td> </td><td> </td></tr></table></td></tr><tr><td><table width='580' border='0' cellspacing='0' cellpadding='0'><tr><td width='180'><strong>Quantities:</strong></td><td width='100'><div align='right'><strong>"
if (estimate.Fields.Item("EQ1").Value) <> 0 then
HTML = HTML & (estimate.Fields.Item("EQ1").Value)
else
HTML = HTML & " "
end if
HTML = HTML & "</strong></div></td><td width='100'><div align='right'><strong>"
if (estimate.Fields.Item("EQ2").Value) <> 0 then
HTML = HTML & (estimate.Fields.Item("EQ2").Value)
else
HTML = HTML & " "
end if
HTML = HTML & "</strong></div></td><td width='100'><div align='right'><strong>"
if (estimate.Fields.Item("EQ3").Value) <> 0 then
HTML = HTML & (estimate.Fields.Item("EQ3").Value)
else
HTML = HTML & " "
end if
HTML = HTML & "</strong></div></td><td><div align='right'><strong>"
if (estimate.Fields.Item("EQ4").Value) <> 0 then
HTML = HTML & (estimate.Fields.Item("EQ4").Value)
else
HTML = HTML & " "
end if
HTML = HTML & "</strong></div></td></tr><tr><td><strong>Prices:</strong></td><td><div align='right'><strong>"
if (estimate.Fields.Item("EP1").Value) <> 0 then
HTML = HTML & FormatCurrency((estimate.Fields.Item("EP1").Value), 2, -2, -2, -2)
else
HTML = HTML & " "
end if
HTML = HTML & "</strong></div></td><td><div align='right'><strong>"
if (estimate.Fields.Item("EP2").Value) <> 0 then
HTML = HTML & FormatCurrency((estimate.Fields.Item("EP2").Value), 2, -2, -2, -2)
else
HTML = HTML & " "
end if
HTML = HTML & "</strong></div></td><td><div align='right'><strong>"
if (estimate.Fields.Item("EP3").Value) <> 0 then
HTML = HTML & FormatCurrency((estimate.Fields.Item("EP3").Value), 2, -2, -2, -2)
else
HTML = HTML & " "
end if
HTML = HTML & "</strong></div></td><td><div align='right'><strong>"
if (estimate.Fields.Item("EP4").Value) <> 0 then
HTML = HTML & FormatCurrency((estimate.Fields.Item("EP4").Value), 2, -2, -2, -2)
else
HTML = HTML & " "
end if
HTML = HTML & "</strong></div></td></tr></table></td></tr><tr><td> </td></tr><tr><td>Your Sincerely,<br><br>" & (estimate.Fields.Item("EUser").Value) & "</td></tr></table></body></html>"
now depending on what code is rendered the errors come in different parts of the file, that is why i am having probelms, as i can force extra characters into the code, but then if the 'IF' statements change the error is in a different place
further tests have found that the HTML string created cuts off 2 characters around about the 2232nd - 2234th character and then continues as normal