Ask a Question related to ASP, Design and Development.
-
Tom Petersen #1
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 _
& " </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
-
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... -
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... -
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:... -
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... -
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... -
Ray at #2
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...of> 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> 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
-
Tom Petersen #3
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...quotes:> I'd imagine it's the "" that you're using. Here are valid usages ofend>
>
> <%
> 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> 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
-
Ray at #4
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...href="http://sd-school/maint/maint.asp?action=id&id=">here</a>> 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 <aobjRS.Fields.Item(0).Value.> 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...> quotes:> > I'd imagine it's the "" that you're using. Here are valid usages of> >
> >
> > <%
> > 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,will> > 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 thatobjRS(""id"")> end> > > point back to the record id but I've got one line getting an expected> > 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=<%=>> >> > > %>"">Click here to check the status of this request." & vbCrLf _
> > >
> >
>
Ray at Guest
-
Tom Petersen #5
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



Reply With Quote

