Solved

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

Posted on 2004-10-30
902 Views
Last Modified: 2012-06-21
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
0
Question by:gkhanduja
    10 Comments
     
    LVL 1

    Expert Comment

    by:dc_cypher
    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
     
    LVL 1

    Expert Comment

    by:dc_cypher
    *carriage returns
    0
     

    Author Comment

    by:gkhanduja
    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
     
    LVL 8

    Expert Comment

    by:pjcrooks2000
    Can you post your html please?

    0
     

    Author Comment

    by:gkhanduja
    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
     
    LVL 1

    Accepted Solution

    by:
    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
     
    LVL 3

    Expert Comment

    by:cheeky-monkey
    We've had that exact same thing. Try using "str1 = str1 & " line by line (break them up into smaller lines) instead of "& _".
    0
     

    Author Comment

    by:gkhanduja
    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
     
    LVL 1

    Expert Comment

    by:dc_cypher
    Are they identical configurations?  If not, how do they differ?
    0
     
    LVL 3

    Expert Comment

    by:cheeky-monkey
    Did you solve this?
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Are you into PHP development and curious how you can make your life easier when publishing your website? Do you sometimes worry you might forget to remove debug lines? Or you spend unnecessary time to double check you haven't accidentally uploaded '…
    Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

    856 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now