HTML Message Contains Exclamation Marks

G

Guest

After sending an email message formatted for HTML using the STMP Mail function within .NET, my message arrives with exclamation marks throughout the text, which inadvertantly hinders the correct formatting of the text.

Importing the source from one of these messages to Microsoft Word, I was able to see that after each of the exclamation marks a hidden paragraph mark exists.

I've read other postings where the developer used StringBuilder and thought that was the problem, but I've tried constructing my messages with and without StringBuilder and still get the same result.

Is this a bug, or is it how I'm sending the message?

Any help would be greatly appreciated.

Ron...
 
G

Guest

Here is the main function that accepts the message and builds it into a table for the HTML message:

Dim siteSettings As SiteSettings = CType(HttpContext.Current.Items("SiteSettings"), SiteSettings)
Dim sb As New StringBuilder

' create the header
sb.Append("<table style=""BORDER-COLLAPSE: collapse"" borderColor=""#111111"" cellSpacing=""0"" cellPadding=""0"" width=""680px"" border=""0"">")
sb.Append("<TR>")
sb.Append("<TD vAlign=""top"" width=""100%"">")
sb.Append("<table id=""AutoNumber1"" style=""BORDER-COLLAPSE: collapse; HEIGHT: 50px"" borderColor=""#111111"" cellSpacing=""0"" cellPadding=""0"" width=""100%"" border=""0"">")
sb.Append("<tr>")
sb.Append("<TD style=""WIDTH: 9px"" noWrap align=""right"" height=""31"" rowSpan=""2""></TD>" & Chr(10))
sb.Append("<td style=""WIDTH: 100px"" noWrap align=""right"" height=""31"" rowSpan=""2""><font color=""#ffffff""><img src=""http://" & MailServer.GetURL(MailTo) & "/images/tabimage2.gif"" id=""imgTabImage"" style=""WIDTH: 56.51%; HEIGHT: 31px"" height=""31"" width=""57"" border=""0""></font></td>")
sb.Append("<td style=""WIDTH: 100%; HEIGHT: 11px"" noWrap colSpan=""2"" height=""11""><img src=""http://" & MailServer.GetURL(MailTo) & "/images/bevel2.gif"" id=""imgBevel"" style=""WIDTH: 100%; HEIGHT: 11px"" border=""0""></td>")
sb.Append("</tr>")
sb.Append("<tr>")
sb.Append("<td style=""WIDTH: 580px"" noWrap width=""580"" bgColor=""#4a7ac9"" height=""20""></td>")
sb.Append("</tr>")
sb.Append("<tr>")
sb.Append("<TD style=""WIDTH: 9px"" noWrap width=""9"" bgColor=""#749cde""></TD>")
sb.Append("<td style=""WIDTH: 87px"" noWrap width=""87"" bgColor=""#749cde""><a id=""HyperLink1"" class=""OtherTabs"" href=""http://" & MailServer.GetURL(MailTo) & "/default.aspx?menuid=1&amp;showlogin=1&remindme=0"" target=""_blank"">Login</a></td>")
sb.Append("<td style=""WIDTH: 580px"" noWrap width=""580"" bgColor=""#749cde""></td>")
sb.Append("</tr>")
sb.Append("</table>" & Chr(10))
sb.Append("<TABLE id=""Table1"" cellSpacing=""0"" cellPadding=""0"" width=""100%"" bgColor=""darkblue"" background=""http://" & MailServer.GetURL(MailTo) & "/images/spacer.gif"" border=""0"">")
sb.Append("<TR>")
sb.Append("<TD></TD>")
sb.Append("</TR>")
sb.Append("</TABLE>" & Chr(10))
sb.Append("</TD>")
sb.Append("</TR>")
sb.Append("</table>" & chr(10))
Dim Header As String = sb.ToString

' build complete message
sb.Length = 0
sb.Append("<html>")
sb.Append("<head>")
sb.Append("<link REL=""stylesheet"" type=""text/css"" href=""http://" & MailServer.GetURL(MailTo) & "/default.css""></link>")
sb.Append("</head>")
sb.Append("<body topmargin=""0"" leftmargin=""0"">")
'sb.Append("<DIV>")

' add the header
sb.Append(Header)

sb.Append("<TABLE class=""normal"" id=""Table3"" cellSpacing=""0"" cellPadding=""0"" width=""680px"" border=""0"">")
sb.Append("<TR>")
sb.Append("<TD style=""WIDTH: 1px"" align=""right"" vAlign=""top""><IMG src=""http://" & MailServer.GetURL(MailTo) & "/Images/Quads/" & siteSettings.AlphaChar & "1.JPG""></TD>")
sb.Append("<TD style=""BACKGROUND-POSITION: left top; BACKGROUND-ATTACHMENT: fixed; BACKGROUND-IMAGE: url(http://" & MailServer.GetURL(MailTo) & "/Images/Quads/" & siteSettings.AlphaChar & "2.JPG); BACKGROUND-REPEAT: no-repeat"" align=""center"">")
sb.Append("<P><STRONG><FONT size=""4"">Highland Meadows Estates</FONT></STRONG></P>")
sb.Append("<P><FONT size=""2"">The official web site for the Highland Meadows Estates Homeowners Association</FONT></P>")
sb.Append("</TD>")
sb.Append("</TR>")
sb.Append("</TABLE>" & Chr(10))
sb.Append("<TABLE class=""normal12"" id=""Table1"" cellSpacing=""0"" cellPadding=""0"" width=""680px"" border=""0"">")
sb.Append("<TR>")
sb.Append("<TD style=""WIDTH: 1px"" align=""right"" vAlign=""top""><IMG src=""http://" & MailServer.GetURL(MailTo) & "/Images/Quads/" & siteSettings.AlphaChar & "3.JPG""></TD>")
sb.Append("<TD style=""BACKGROUND-POSITION: left top; BACKGROUND-ATTACHMENT: fixed; BACKGROUND-IMAGE: url(http://" & MailServer.GetURL(MailTo) & "/Images/Quads/" & siteSettings.AlphaChar & "4.JPG); BACKGROUND-REPEAT: no-repeat; HEIGHT: 176px"">")

' add the body
sb.Append(Body)

sb.Append("<P align=""center""><FONT size=""3""><STRONG><EM>""Stay Connected with your Community""</EM></STRONG></FONT></P>")

sb.Append("</TD>")
sb.Append("</TR>")
sb.Append("</TABLE>" & Chr(10))

sb.Append("<TABLE id=""Table1"" cellSpacing=""0"" cellPadding=""0"" width=""680px"" border=""0"" height=""100"" valign=""bottom"">")
sb.Append("<TR>")
sb.Append("<TD style=""WIDTH: 106px""></TD>")
sb.Append("<TD vAlign=""bottom""><FONT face=""Arial"" size=""1"">")
sb.Append("<P>How to Unsubscribe: This message was delivered to " & MailTo & " on " & Format(Now.Date, "D") & ". To unsubscribe or change your options in receiving messages like this one, please visit <A href=""http://" & MailServer.GetURL(MailTo) & """>www.hmehoa.com</A>, sign in and click on Edit My Account, or you can respond to this message and ask to be removed from this mailing list.</P>")

sb.Append("<P>© " & Convert.ToString(Now.Year) & " Highland Meadows Estates Homeowners Association. All Rights Reserved.</P>")
sb.Append("</FONT></TD>")
sb.Append("</TR>")
sb.Append("</TABLE>" & Chr(10))

'sb.Append("</DIV>")
sb.Append("</body>")
sb.Append("</html>")

Return sb.ToString
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top