HTML Message Contains Exclamation Marks

Discussion in 'ASP .Net' started by =?Utf-8?B?cnZhbnZvbGtlbg==?=, Jun 22, 2004.

  1. 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...
     
    =?Utf-8?B?cnZhbnZvbGtlbg==?=, Jun 22, 2004
    #1
    1. Advertising

  2. Can you post some code for how you are building the message?

    "rvanvolken" wrote:

    > 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...
     
    =?Utf-8?B?RGF2aWQgQ29lLCBNQ1A=?=, Jun 22, 2004
    #2
    1. Advertising

  3. 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


    "David Coe, MCP" wrote:

    > Can you post some code for how you are building the message?
    >
    > "rvanvolken" wrote:
    >
    > > 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...
     
    =?Utf-8?B?cnZhbnZvbGtlbg==?=, Jun 22, 2004
    #3
  4. =?Utf-8?B?cnZhbnZvbGtlbg==?=

    cm-mcninch Guest

    cm-mcninch, Jun 24, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. James Dyer
    Replies:
    5
    Views:
    665
  2. Sheldon
    Replies:
    5
    Views:
    6,237
    Willem
    Nov 6, 2007
  3. Nick Brown
    Replies:
    19
    Views:
    210
    Michael Morin
    Aug 21, 2008
  4. Guy
    Replies:
    4
    Views:
    188
    David Dorward
    Dec 13, 2003
  5. philhege

    exclamation point in field name

    philhege, Jun 7, 2005, in forum: Javascript
    Replies:
    2
    Views:
    90
    Mick White
    Jun 7, 2005
Loading...

Share This Page