Syntax problem with HTML output in email

Ask a Question related to ASP, Design and Development.

  1. #1

    Default Syntax problem with HTML output in email

    I am using ASP to send the user an email with a clickable link that will
    point back to the record id but I've got one line getting an expected end of
    statement that I can't figure out...


    & "<p><font face=""Verdana"" size=""2""><a
    href=""http://sd-school/maint/maint.asp?action=edit&id=<%= objRS(""id"")
    %>"">Click here to check the status of this request." & vbCrLf _

    ideally I would just like the word 'here' to be the hyperlink, but first
    things first... :)
    Here is the whole mess, everything works great except for the above line,
    because I can't figure out the right syntax...

    emailBody = "<html>" & vbCrLf _
    & "<head>" & vbCrLf _
    & "<title>New Page 3</title> " & vbCrLf _
    & "</head> " & vbCrLf _
    & "<body> " & vbCrLf _
    & "<div align=""center""> " & vbCrLf _
    & "<table border=""0"" style=""border-collapse: collapse""
    width=""64%"" id=""table1""> " & vbCrLf _
    & " <tr> " & vbCrLf _
    & "<td width=""4"" style=""border-left: 2px solid #3399FF;
    border-top: 2px solid #3399FF""></td> " & vbCrLf _
    & "<td width=""484"" style=""border-top:2px solid #3399FF;
    border-left-width:1px; border-right-width:1px; border-bottom-width:1px""> "
    & vbCrLf _
    & "<p align=""center""> " & vbCrLf _
    & "<img border=""0"" src=""http://sd-school/pic/sdsd.h1.gif""
    width=""476"" height=""92""></td> " & vbCrLf _
    & "<td width=""4"" style=""border-right:2px solid #3399FF;
    border-top:2px solid #3399FF;"" ></td> " & vbCrLf _
    & "</tr> " & vbCrLf _
    & "<tr> " & vbCrLf _
    & "<td width=""4"" style=""border-left: 2px solid #3399FF""></td> "
    & vbCrLf _
    & "<td width=""484""> " & vbCrLf _
    & "<p align=""center""><span style=""letter-spacing: 2pt""><b> " &
    vbCrLf _
    & "<font face=Verdana>Maintenance Confirmation
    Page</font></b></span></td> " & vbCrLf _
    & "<td width=""4"" style=""border-right: 2px solid #3399FF""></td> "
    & vbCrLf _
    & "</tr> " & vbCrLf _
    & "<tr> " & vbCrLf _
    & "<td width=""4"" style=""border-left: 2px solid #3399FF;
    border-bottom: 2px solid #3399FF""></td> " & vbCrLf _
    & "<td width=""484"" style=""border-right-width: medium;
    border-bottom: 2px solid #3399FF""> " & vbCrLf _
    & "<hr noshade color=""#3399FF""> " & vbCrLf _
    & "<p><font face=""Verdana"" size=""2""><a
    href=""http://sd-school/maint/maint.asp?action=edit&id=<%= objRS(""id"")
    %>"">Click here to check the status of this request." & vbCrLf _
    & "Or click here to see all of your requests.<br> " & vbCrLf _
    & "&nbsp;</font></td> " & vbCrLf _
    & "<td width=""4"" style=""border-left-width: medium; border-right:
    2px solid #3399FF; border-bottom: 2px solid #3399FF""></td> " & vbCrLf _
    & "</tr> " & vbCrLf _
    & "</table> " & vbCrLf _
    & "</div> " & vbCrLf _
    & "</body> " & vbCrLf _
    & "</html> " & vbCrLf

    TIA!
    Tom


    Tom Petersen Guest

  2. Similar Questions and Discussions

    1. html email hotspots problem
      Hello, I created a simple HTML page with graphics and links that I sending as and email. I've posted my page and I use the "Send page as email" to...
    2. PHP/HTML web syntax highlighter available
      I've released the first proper version of my PHP/HTML syntax highlighter. This program takes HTML from a URL or a file, syntax highlights it and...
    3. jumping to an html anchor with ? syntax
      Hi there, I am wondering how it is possible to jump to a name anchor with an url containing a questionmark. Things like:...
    4. custom syntax highlighting in html-kit
      Hello, I'd REALLY REALLY like to be able to modify the syntax highlighting in html-kit. Is this possible? Right now in PHP if you have a line...
    5. web form output to email and sql
      I have a couple of requirements I need the output of a webform to be directed to emails based on a choice on the form I need the output to also go...
  3. #2

    Default Re: Syntax problem with HTML output in email

    I'd imagine it's the "" that you're using. Here are valid usages of quotes:


    <%
    Response.write "<a href=""something.com"">click me</a>"
    %>

    <%
    sHTML = "<a href=""something.com?id=" & objRS("id") & """>click me</a>"
    %>

    <a href="something.com?id=<%=objRS("id")%>">click me</a>


    So, in other words, you want to use objRS("id"), or better,
    objRS.Fields.Item("id").Value, or better yet, objRS.Fields.Item(0).Value.
    Or replace 0 with the index of the column from your select query.

    Ray at work

    "Tom Petersen" <petert@sdsd.sdbor.edu> wrote in message
    news:eqbW7pZmDHA.2140@TK2MSFTNGP09.phx.gbl...
    > I am using ASP to send the user an email with a clickable link that will
    > point back to the record id but I've got one line getting an expected end
    of
    > statement that I can't figure out...
    >
    >
    > & "<p><font face=""Verdana"" size=""2""><a
    > href=""http://sd-school/maint/maint.asp?action=edit&id=<%= objRS(""id"")
    > %>"">Click here to check the status of this request." & vbCrLf _
    >

    Ray at Guest

  4. #3

    Default Re: Syntax problem with HTML output in email

    It looks like I do need the double quotes, this line works fine
    & " Click <a
    href=""http://sd-school/maint/maint.asp?action=id&id="">here</a> to check
    status.<br>" & vbCrLf _

    but this does not
    & " Click <a href="http://sd-school/maint/maint.asp?action=id&id=">here</a>
    to check status.<br>" & vbCrLf _

    But what is still throwing me off is how to insert the <%= objRS("id") %>
    with the right syntax afer the &id=


    "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    news:%23t1ZDvZmDHA.2068@TK2MSFTNGP09.phx.gbl...
    > I'd imagine it's the "" that you're using. Here are valid usages of
    quotes:
    >
    >
    > <%
    > Response.write "<a href=""something.com"">click me</a>"
    > %>
    >
    > <%
    > sHTML = "<a href=""something.com?id=" & objRS("id") & """>click me</a>"
    > %>
    >
    > <a href="something.com?id=<%=objRS("id")%>">click me</a>
    >
    >
    > So, in other words, you want to use objRS("id"), or better,
    > objRS.Fields.Item("id").Value, or better yet, objRS.Fields.Item(0).Value.
    > Or replace 0 with the index of the column from your select query.
    >
    > Ray at work
    >
    > "Tom Petersen" <petert@sdsd.sdbor.edu> wrote in message
    > news:eqbW7pZmDHA.2140@TK2MSFTNGP09.phx.gbl...
    > > I am using ASP to send the user an email with a clickable link that will
    > > point back to the record id but I've got one line getting an expected
    end
    > of
    > > statement that I can't figure out...
    > >
    > >
    > > & "<p><font face=""Verdana"" size=""2""><a
    > > href=""http://sd-school/maint/maint.asp?action=edit&id=<%= objRS(""id"")
    > > %>"">Click here to check the status of this request." & vbCrLf _
    > >
    >
    >

    Tom Petersen Guest

  5. #4

    Default Re: Syntax problem with HTML output in email

    It depends if you're in a script block or out of it. Look at these
    examples:


    <html>
    <head>
    </head>
    <body>
    <a href="page.asp?id=<%=objRS("id")%>">click me</a>
    </body>







    <%
    sVar = "1"

    response.write "<html>"
    response.write "<head>"
    response.write "</head>"
    response.write "<body>"
    response.write "<a href=""page.asp?id=" & objRS("id") & """>click me</a>"
    response.write "</body>"
    %>



    Can you see the difference?

    Ray at work











    "Tom Petersen" <petert@sdsd.sdbor.edu> wrote in message
    news:e8ohdfamDHA.3316@TK2MSFTNGP11.phx.gbl...
    > It looks like I do need the double quotes, this line works fine
    > & " Click <a
    > href=""http://sd-school/maint/maint.asp?action=id&id="">here</a> to check
    > status.<br>" & vbCrLf _
    >
    > but this does not
    > & " Click <a
    href="http://sd-school/maint/maint.asp?action=id&id=">here</a>
    > to check status.<br>" & vbCrLf _
    >
    > But what is still throwing me off is how to insert the <%= objRS("id") %>
    > with the right syntax afer the &id=
    >
    >
    > "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    > news:%23t1ZDvZmDHA.2068@TK2MSFTNGP09.phx.gbl...
    > > I'd imagine it's the "" that you're using. Here are valid usages of
    > quotes:
    > >
    > >
    > > <%
    > > Response.write "<a href=""something.com"">click me</a>"
    > > %>
    > >
    > > <%
    > > sHTML = "<a href=""something.com?id=" & objRS("id") & """>click me</a>"
    > > %>
    > >
    > > <a href="something.com?id=<%=objRS("id")%>">click me</a>
    > >
    > >
    > > So, in other words, you want to use objRS("id"), or better,
    > > objRS.Fields.Item("id").Value, or better yet,
    objRS.Fields.Item(0).Value.
    > > Or replace 0 with the index of the column from your select query.
    > >
    > > Ray at work
    > >
    > > "Tom Petersen" <petert@sdsd.sdbor.edu> wrote in message
    > > news:eqbW7pZmDHA.2140@TK2MSFTNGP09.phx.gbl...
    > > > I am using ASP to send the user an email with a clickable link that
    will
    > > > point back to the record id but I've got one line getting an expected
    > end
    > > of
    > > > statement that I can't figure out...
    > > >
    > > >
    > > > & "<p><font face=""Verdana"" size=""2""><a
    > > > href=""http://sd-school/maint/maint.asp?action=edit&id=<%=
    objRS(""id"")
    > > > %>"">Click here to check the status of this request." & vbCrLf _
    > > >
    > >
    > >
    >
    >

    Ray at Guest

  6. #5

    Default Re: Syntax problem with HTML output in email

    Yep, got it thanks!!!!

    "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    news:%23o0Q4samDHA.2404@TK2MSFTNGP12.phx.gbl...
    > It depends if you're in a script block or out of it. Look at these
    > examples:
    >
    >
    > <html>
    > <head>
    > </head>
    > <body>
    > <a href="page.asp?id=<%=objRS("id")%>">click me</a>
    > </body>
    >
    >
    >
    >
    >
    >
    >
    > <%
    > sVar = "1"
    >
    > response.write "<html>"
    > response.write "<head>"
    > response.write "</head>"
    > response.write "<body>"
    > response.write "<a href=""page.asp?id=" & objRS("id") & """>click me</a>"
    > response.write "</body>"
    > %>
    >
    >
    >
    > Can you see the difference?
    >
    > Ray at work

    Tom Petersen Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139