EXCLAMATION MARKS APPEARING IN THE HTML EMAIL SENT USING SMTPMAIL IN ASP.NET --URGENT

I am trying to send an email using the SMTPmail and there are exclamation marks appearing in the text.
For example :

We are now conducting its investigati! on.

I would appreciate any help in this regard.

Thanks
gkhandujaAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
dc_cypherConnect With a Mentor Commented:
I'm not convinced that it isn't a failure to wrap lines properly because, from the looks of this code, everything in your string str is all on one line.  For all lines ending in "& _", try replacing that with "& vbCrLf & _".
0
 
dc_cypherCommented:
Make sure your lines are separated by carriate returns when appropriate (force wrap every ~100 characters or so -- just keep it low).  I had the same problem (albeit in a different environment) where after 1024 characters, exclamation points would appear in the text.
0
 
dc_cypherCommented:
*carriage returns
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
gkhandujaAuthor Commented:
I am also creating a table in HTML I am sending and it header is also having the exclamation sign .... This is also due to the same reason or something else.
0
 
pjcrooks2000Commented:
Can you post your html please?

0
 
gkhandujaAuthor Commented:
Here is the code:

I would appreciate any help. The exclamation marks are appearing just like that. They are not consistent, I tried word wrapping but exclamation marks shift here and there but they dont go.

*******************************************************************************************

        str = "Some text" & rightNow.ToString("MM/dd/yyyy") & ":"
        str2 = "Some text 0"
        str5 = "Some text 1"
        str6 = "Some text 2"
        str7 = "Some text 3"
        str3 = "Thank you."
        str4 = "For support: Support@xxx.com"
        'str5 = "Some text 4"
        If Not (Page.IsPostBack) Then

            str1 = "<html>" & _
                "<head>" & _
                "<meta http-equiv=" & Chr(34) & "Content-Language" & Chr(34) & "content=" & Chr(34) & "en-us" & Chr(34) & ">" & _
                "<meta name=" & Chr(34) & "GENERATOR" & Chr(34) & " content=" & Chr(34) & "Microsoft FrontPage 5.0" & Chr(34) & ">" & _
                "<meta name=" & Chr(34) & "ProgId" & Chr(34) & " content=" & Chr(34) & "FrontPage.Editor.Document" & Chr(34) & ">" & _
                "<meta http-equiv=" & Chr(34) & "Content-Type" & Chr(34) & " content=" & Chr(34) & "text/html; charset=windows-1252" & Chr(34) & ">" & _
                "<title>New Page 1</title>" & _
                "</head>" & _
                "" & _
                "<body>" & _
                "<IMG style=" & Chr(34) & "Z-INDEX: 101; LEFT: 9px; WIDTH: 983px; POSITION: relative; TOP: 9px; HEIGHT: 134px" & Chr(34) & " height=" & Chr(34) & "134" & Chr(34) & " alt=" & Chr(34) & "" & Chr(34) & " src=" & Chr(34) & "http://xxx.com/images/email_logo.bmp" & Chr(34) & " width=" & Chr(34) & "983" & Chr(34) & ">" & _
                "<p><font face=" & Chr(34) & "Arial" & Chr(34) & ">Dear " & Session("email1") & ",</font></p>" & _
                "<p><font face=" & Chr(34) & "Arial" & Chr(34) & ">" & str & "</font></p>" & _
                  "<table border=" & Chr(34) & "1" & Chr(34) & " cellpadding=" & Chr(34) & "0" & Chr(34) & " cellspacing=" & Chr(34) & "0" & Chr(34) & " style=" & Chr(34) & "border-collapse: collapse & Chr(34) & "" bordercolor=" & Chr(34) & "#111111" & Chr(34) & " width=" & Chr(34) & "50%" & Chr(34) & " id=" & Chr(34) & "AutoNumber1" & Chr(34) & "><br>" & _
                    "<tr>" & _
                    "<td width=" & Chr(34) & "10%" & Chr(34) & " align=" & Chr(34) & "center" & Chr(34) & "><font face=" & Chr(34) & "Arial" & Chr(34) & ">Last Name</font></td>" & _
    "<td width=" & Chr(34) & "10%" & Chr(34) & " align=" & Chr(34) & "center" & Chr(34) & "><font face=" & Chr(34) & "Arial" & Chr(34) & ">First Name</font></td>" & _
    "<td width=" & Chr(34) & "1%" & Chr(34) & " align=" & Chr(34) & "center" & Chr(34) & "><font face=" & Chr(34) & "Arial" & Chr(34) & "> </font></td>" & _
    "<td width=" & Chr(34) & "10%" & Chr(34) & " align=" & Chr(34) & "center" & Chr(34) & "><font face=" & Chr(34) & "Arial" & Chr(34) & ">" & ref1 & "</font></td>" & _
    "<td width=" & Chr(34) & "10%" & Chr(34) & " align=" & Chr(34) & "center" & Chr(34) & "><font face=" & Chr(34) & "Arial" & Chr(34) & ">" & ref2 & "</font></td>" & _
    "<td width=" & Chr(34) & "10%" & Chr(34) & " align=" & Chr(34) & "center" & Chr(34) & "><font face=" & Chr(34) & "Arial" & Chr(34) & ">Tracking Number</font></td>" & _
    "</tr>"


            For i = 0 To dg.Items.Count - 1
                name_last = dg.Items(i).Cells(1).Text.Trim()
                name_first = dg.Items(i).Cells(0).Text.Trim()
                cusref1 = dg.Items(i).Cells(2).Text.Trim()
                cusref2 = dg.Items(i).Cells(3).Text.Trim()
                trackingno = dg.Items(i).Cells(4).Text.Trim()


                str1 = str1 & _
                                "<tr>" & _
    "<td width=" & Chr(34) & "10%" & Chr(34) & " align=" & Chr(34) & "center" & Chr(34) & "><font face=" & Chr(34) & "Arial" & Chr(34) & ">" & name_last & "</font></td>" & _
    "<td width=" & Chr(34) & "10%" & Chr(34) & " align=" & Chr(34) & "center" & Chr(34) & "><font face=" & Chr(34) & "Arial" & Chr(34) & ">" & name_first & "</font></td>" & _
    "<td width=" & Chr(34) & "1%" & Chr(34) & " align=" & Chr(34) & "center" & Chr(34) & "><font face=" & Chr(34) & "Arial" & Chr(34) & "> </font></td>" & _
    "<td width=" & Chr(34) & "10%" & Chr(34) & " align=" & Chr(34) & "center" & Chr(34) & "><font face=" & Chr(34) & "Arial" & Chr(34) & ">" & cusref1 & "</font></td>" & _
    "<td width=" & Chr(34) & "10%" & Chr(34) & " align=" & Chr(34) & "center" & Chr(34) & "><font face=" & Chr(34) & "Arial" & Chr(34) & ">" & cusref2 & "</font></td>" & _
    "<td width=" & Chr(34) & "10%" & Chr(34) & " align=" & Chr(34) & "center" & Chr(34) & "><font face=" & Chr(34) & "Arial" & Chr(34) & ">" & trackingno & "</font></td>" & _
    "</tr>"
            Next
            str1 = str1 & _
                    "</table><p><font face=" & Chr(34) & "Arial" & Chr(34) & ">" & str2 & "</font></p>" & _
                    "<p><font face=" & Chr(34) & "Arial" & Chr(34) & ">" & str5 & "</font></p>" & _
                    "<p><font face=" & Chr(34) & "Arial" & Chr(34) & ">" & str6 & "</font></p>" & _
                    "<p><font face=" & Chr(34) & "Arial" & Chr(34) & ">" & str7 & "</font></p>" & _
                    "<p><font face=" & Chr(34) & "Arial" & Chr(34) & ">" & str3 & "</font></p>" & _
                    "<p><font face=" & Chr(34) & "Arial" & Chr(34) & ">" & str4 & "</font></p>" & _
                    "" & _
                    "</body>" & _
                    "" & _
                    "</html>"
0
 
cheeky-monkeyCommented:
We've had that exact same thing. Try using "str1 = str1 & " line by line (break them up into smaller lines) instead of "& _".
0
 
gkhandujaAuthor Commented:
Hi

I have introduced "& vbCrLf &_" in the code, we have 2 machines to test, on one machine this exclamation mark is appearing and on other it is not appearing.

Can you guys suggest something??

Thanks

0
 
dc_cypherCommented:
Are they identical configurations?  If not, how do they differ?
0
 
cheeky-monkeyCommented:
Did you solve this?
0
All Courses

From novice to tech pro — start learning today.