Syntax problem with HTML output in email

T

Tom Petersen

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
 
R

Ray at

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
 
R

Ray at

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
 

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

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top