Hi. Once in a while when loading certain messages, I get an exception "Value was either too large or too small for a character". I suspect there is a weird char in the body but I'm not sure. Have you seen this before and do you have any suggested solutions?
It comes from EAGetMail.Mail.HtmlBody in code similar to this:
public static string GetMailMessageBody(Mail message)
{
string bodyHtml = message.HtmlBody;
return bodyHtml;
}
Exception:
System.OverflowException: Value was either too large or too small for a character at System.Convert.ToChar(Int32 value)
at EAGetMail.Mail.4x(String Bt)
at EAGetMail.Mail.
at EAGetMail.Mail.get_HtmlBody()
Here's the body of one of the offending messages:
<!DOCTYPE html>=0D=0A<html lang=3D"en" xmlns=3D"http://www.w3.org=
/1999/xhtml">=0D=0A<head>=0D=0A <meta charset=3D"utf-8" />=0D=0A=
<title></title>=0D=0A <style type=3D"text/css">=0D=0A a:lin=
k {color:#003399;text-decoration:underline;text-underline:single}=
=0D=0A .body {font-size:10pt;font-family:Arial,Helvetica,sans-=
serif}=0D=0A .dlh {font-size:10pt;font-family:Arial,Helvetica,=
sans-serif;background-color:#808080;font-weight:bold}=0D=0A .d=
lm {font-size:10pt;font-family:Arial,Helvetica,sans-serif;backgro=
und-color:#C0C0C0}=0D=0A .dla {font-size:10pt;font-family:Aria=
l,Helvetica,sans-serif;background-color:#FFFFFF}=0D=0A </style>=0D=0A=
</head>=0D=0A<body class=3D"body">=0D=0A <p><a href=3D"http://ww=
w.microsoft.com/exchange/services"><img src=3D"http://na01.admin.=
protection.outlook.com/SpamDigest/SpamDigestLogo.png" alt=3D"Offi=
ce 365" border=3D"0"></a></p>=0D=0A <p>Dear REDACTED@REDACTED=
S.COM:</p>=0D=0A <p>You have 2 new spam-quarantined messages as =
of July 1, 2015 12:00 AM (UTC) which are listed below along with =
the actions that can be taken:</p>=0D=0A <p><strong>Release to I=
nbox:</strong> Send the message to your Inbox.</p>=0D=0A <p><str=
ong>Report as Not Junk:</strong> Send a copy of the message to Mi=
crosoft for analysis.</p>=0D=0A <table style=3D"width:100%">=0D=0A=
<tr class=3D"dlh">=0D=0A <td>Sender</td>=0D=0A <td>=
Subject</td>=0D=0A <td>Date (UTC)</td>=0D=0A <td>Size</=
td>=0D=0A <td>Release</td>=0D=0A <td>Report</td>=0D=0A =
</tr>=0D=0A <tr id=3D"DetailLineMain" class=3D"dlm">=0D=0A =
<td>"info@e.flyfrontier.com" <info@e.flyfrontie=
r.com></td>=0D=0A <td>We're Turning 21! Celebrate wit=
h $21* Fares 🎉✈</td>=0D=0A <td>Jun 30,&nb=
sp;2015 7:23 AM</td>=0D=0A <td>31330</td>=0D=0A =
<td><a href=3D"https://na01-quarantine.dataservice.protection.=
outlook.com/SpamDigest/SpamDigest.svc/releasespam/orgs/807e7447-7=
342-46c3-89df-691aa4fcf1d2/users/REDACTED@REDACTED.COM/mail/3=
03b612a-d2a5-4944-2a73-08d2811cd1d9?token=3D%2b0IOqlPPC2G65%2bxx6=
kj0f3%2fKnMA5hAom%2bU3fruhiJsk%3d">Release to Inbox</a></td>=0D=0A=
<td><a href=3D"https://na01-quarantine.dataservice.protecti=
on.outlook.com/SpamDigest/SpamDigest.svc/reportfalsepositive/orgs=
/807e7447-7342-46c3-89df-691aa4fcf1d2/users/REDACTED@REDACTED=
.COM/mail/303b612a-d2a5-4944-2a73-08d2811cd1d9?token=3DMqgS6e6gNN=
56XgpSwv0TxDcmi7anVxlyU67hIjS9Yzw%3d">Report as Not Junk</a></td>=
=0D=0A </tr><tr id=3D"DetailLineAlternate" class=3D"dla">=0D=0A=
<td>"info@info.3ecompany.com" <info@info.3ecom=
pany.com></td>=0D=0A <td>3E EH&S Express Newsletter -=
June 2015</td>=0D=0A <td>Jun 30, 2015 11:10&=
nbsp;PM</td>=0D=0A <td>77074</td>=0D=0A <td><a href=3D"=
https://na01-quarantine.dataservice.protection.outlook.com/SpamDi=
gest/SpamDigest.svc/releasespam/orgs/807e7447-7342-46c3-89df-691a=
a4fcf1d2/users/REDACTED@REDACTED.COM/mail/1e0e80a1-ca61-4f5a-=
3dde-08d281a110dc?token=3D%2buiblPzkWRFnneR7QG%2b4acsMvNcTJCr71OM=
mOLRoxvw%3d">Release to Inbox</a></td>=0D=0A <td><a href=3D"=
https://na01-quarantine.dataservice.protection.outlook.com/SpamDi=
gest/SpamDigest.svc/reportfalsepositive/orgs/807e7447-7342-46c3-8=
9df-691aa4fcf1d2/users/REDACTED@REDACTED.COM/mail/1e0e80a1-ca=
61-4f5a-3dde-08d281a110dc?token=3DvZWAADbc9bKh6LX1elZ8HJhm2ItFRdH=
HI%2bnnOEPDw%2bQ%3d">Report as Not Junk</a></td>=0D=0A </tr>=0D=0A=
</table>=0D=0A <p style=3D"font-size:8pt">© 2015 Microsof=
t Corporation. All rights reserved. | <a href=3D"http://go.micros=
oft.com/fwlink/?LinkID=3D79398">Acceptable Use Policy</a> | <a hr=
ef=3D"http://go.microsoft.com/fwlink/?LinkID=3D138500">Privacy No=
tice</a></p>=0D=0A</body>=0D=0A</html>=0D=0A
Edited by user
10 years ago
|
Reason: Not specified