How to create a mailto link?whats mistake in this Response.write "<A HREF = "mailto:" &
How to create a mailto link?whats mistake in this Response.write "<A HREF = "mailto:" &
am 26.09.2006 11:11:31 von divya
I have a Column in the Table named EMAIL which containd all the email
addresses.
Now I want to create mailto links for the entries of this column.
I used something like this inside the Do while Not objRs.EOF loop.
Response.write "" &
objrs("EMAIL") & ""
But this is not displaying anything why????????? Please tell me wats
wrong with this statement ,I want these address to be displayed on a
ASP page. Kindly help with the procedure to use the anchor tags in the
Response.Write.
Divya
Re: How to create a mailto link?whats mistake in this Response.write "<A HREF = "mailto:&quo
am 26.09.2006 11:18:39 von Daniel Crichton
divya wrote on 26 Sep 2006 02:11:31 -0700:
> I have a Column in the Table named EMAIL which containd all the email
> addresses.
> Now I want to create mailto links for the entries of this column.
>
> I used something like this inside the Do while Not objRs.EOF loop.
>
> Response.write "" &
> objrs("EMAIL") & ""
>
> But this is not displaying anything why????????? Please tell me wats
> wrong with this statement ,I want these address to be displayed on a
> ASP page. Kindly help with the procedure to use the anchor tags in the
> Response.Write.
>
> Divya
Did you make sure objrs("EMAIL") is not empty? Or null?
Maybe it's the use of single quotes in the HTML (those are not in the W3C
spec). Try this:
Response.write "" &
objrs("EMAIL") & ""
As you can see, to put a double quote into the string, just use it twice in
succession to prevent the script processor from treating it as a string
delimiter.
Dan
Re: How to create a mailto link?whats mistake in this Response.write "<A HREF = "mailto:&quo
am 26.09.2006 11:51:00 von divya
Hii Daniel,
> > Response.write "" &
> > objrs("EMAIL") & ""
This also gives me the same result.Plz tell me y is it
not displaying anything???????
> Did you make sure objrs("EMAIL") is not empty? Or null?
It displays the entries of other columns and EMAIL,
when I give
Response.write objrs("EMAIL")
It displays all the email addresses .But I want a mailto link. I am not
understanding what happens when I use a anchor tag inside
response.write. Any other way of doing?????? Plz help.
I am thinking to use the %> and write anchor tag in the HTML and again
start the script ag<%
<%
Do while Not objRs.EOF
%>
" &<% objrs("EMAIL") %> &
""
<%
.................
Let me see if this works.
Divya
Daniel Crichton wrote:
> divya wrote on 26 Sep 2006 02:11:31 -0700:
>
> > I have a Column in the Table named EMAIL which containd all the email
> > addresses.
> > Now I want to create mailto links for the entries of this column.
> >
> > I used something like this inside the Do while Not objRs.EOF loop.
> >
> > Response.write "" &
> > objrs("EMAIL") & ""
> >
> > But this is not displaying anything why????????? Please tell me wats
> > wrong with this statement ,I want these address to be displayed on a
> > ASP page. Kindly help with the procedure to use the anchor tags in the
> > Response.Write.
> >
> > Divya
>
> Did you make sure objrs("EMAIL") is not empty? Or null?
>
> Maybe it's the use of single quotes in the HTML (those are not in the W3C
> spec). Try this:
>
> Response.write "" &
> objrs("EMAIL") & ""
>
> As you can see, to put a double quote into the string, just use it twice in
> succession to prevent the script processor from treating it as a string
> delimiter.
>
> Dan
Re: How to create a mailto link?whats mistake in this Response.write "<A HREF = "mailto:&quo
am 26.09.2006 12:03:54 von exjxw.hannivoort
divya wrote on 26 sep 2006 in microsoft.public.inetserver.asp.db:
> <%
> Do while Not objRs.EOF
> %>
> " &<% objrs("EMAIL") %> &
> ""
> <%
>
No, that's wrong, try:
......
Do while Not objrs.eof
%>
<% = objrs("EMAIL") %>
<%
......
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Re: How to create a mailto link?whats mistake in this Response.write "<A HREF = "mailto:&quo
am 26.09.2006 12:27:45 von divya
Thnx for the code but I want to use the anhor tag along with the
response.write
response.write ""
"CLICKME"
when I give above statement It displays Clickme on the page and when I
click the compose mail window opens with objrs("EMAIL") in the to
field.
But I don't want to give CLICK ME I want to give the objrs("EMAIL") i.e
the email address insetead so I changed the code to
response.write "" &
objrs("EMAIL") & ""
But this doesnot display anything(nor does it give any eror) , It
should display the emailaddress in place of Clickme is what I
expected,but it doen't whyyyyyy??? Is there any syntax error in the
above line????
Please Help.
Divya
Evertjan. wrote:
> divya wrote on 26 sep 2006 in microsoft.public.inetserver.asp.db:
>
> > <%
> > Do while Not objRs.EOF
> > %>
> > " &<% objrs("EMAIL") %> &
> > ""
> > <%
> >
>
> No, that's wrong, try:
>
> .....
> Do while Not objrs.eof
> %>
>
> <% = objrs("EMAIL") %>
>
> <%
> .....
>
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)
Re: How to create a mailto link?whats mistake in this Response.write "<A HREF = "mailto:&quo
am 26.09.2006 12:38:55 von Daniel Crichton
divya wrote on 26 Sep 2006 03:27:45 -0700:
> Thnx for the code but I want to use the anhor tag along with the
> response.write
>
> response.write ""
> "CLICKME"
>
> when I give above statement It displays Clickme on the page and when I
> click the compose mail window opens with objrs("EMAIL") in the to
> field.
>
> But I don't want to give CLICK ME I want to give the objrs("EMAIL") i.e
> the email address insetead so I changed the code to
>
> response.write "" &
> objrs("EMAIL") & ""
>
> But this doesnot display anything(nor does it give any eror) , It
> should display the emailaddress in place of Clickme is what I
> expected,but it doen't whyyyyyy??? Is there any syntax error in the
> above line????
Does objrs pull any TEXT columns (SQL Server) or MEMO (Access), that are to
the left of the EMAIL column in the recordset? If so, and you're using a
server side cursor, then the first time you read the column data it will be
discarded by ADO (IIRC the pointer to the column in the database is
discarded on the first read as it's assumed that when it's read once it'll
no longer be needed, saving resources), so the second read will be blank.
Try this:
Do Until objrs.EOF
strEmail = objrs("EMAIL")
response.write "" & strEmail &
""
objrs.MoveNext
Loop
Oh, and you might want to put a
at the end of the line if you don't
want them all on one line.
Dan
Re: How to create a mailto link?whats mistake in this Response.write "<A HREF = "mailto:&quo
am 26.09.2006 12:42:19 von divya
Hi Daniel and Evertjan
Hey my problem is solved atlas ,but I still don't know the reason
behind it.
I replaced this line:-
response.write "" &
objrs("EMAIL") & ""
with these lines:-
Dim dbemail
dbemail= objrs("EMAIL")
response.write "" & dbemail &
""
(Replaced second objrs("EMAIL") with dbemail )
Now It displays properly all the emailaddresses with a mailto link.
Even this works
response.write "" &
objrs("NAME") & ""
where instead of second objrs("EMAIL") I used objrs("NAME")
So when objrs("EMAIL") is used at both the places it doesnot give any
output on the page.Can anybody explain the reason behind this
behaviour????
Regards,
Divya
divya wrote:
> Thnx for the code but I want to use the anhor tag along with the
> response.write
>
> response.write ""
> "CLICKME"
>
> when I give above statement It displays Clickme on the page and when I
> click the compose mail window opens with objrs("EMAIL") in the to
> field.
>
> But I don't want to give CLICK ME I want to give the objrs("EMAIL") i.e
> the email address insetead so I changed the code to
>
> response.write "" &
> objrs("EMAIL") & ""
>
> But this doesnot display anything(nor does it give any eror) , It
> should display the emailaddress in place of Clickme is what I
> expected,but it doen't whyyyyyy??? Is there any syntax error in the
> above line????
>
> Please Help.
> Divya
>
>
>
>
> Evertjan. wrote:
> > divya wrote on 26 sep 2006 in microsoft.public.inetserver.asp.db:
> >
> > > <%
> > > Do while Not objRs.EOF
> > > %>
> > > " &<% objrs("EMAIL") %> &
> > > ""
> > > <%
> > >
> >
> > No, that's wrong, try:
> >
> > .....
> > Do while Not objrs.eof
> > %>
> >
> > <% = objrs("EMAIL") %>
> >
> > <%
> > .....
> >
> >
> > --
> > Evertjan.
> > The Netherlands.
> > (Please change the x'es to dots in my emailaddress)
Re: How to create a mailto link?whats mistake in this Response.write "<A HREF = "mailto:&quo
am 26.09.2006 12:42:19 von Daniel Crichton
In addition to my other reply, you could move the TEXT/MEMO column to the
end of the results if you really need it, leave it out altogether if you
don't (don't use SELECT * when requesting rows from the database, use a
specific column list to reduce the amount of data having to be passed and
stored, if there are no TEXT/MEMO columns then you won't see this
behaviour), or change the recordset cursor to client-sided (slower, but you
can read each column as many times as you like) using the adUseClient value
for the CursorLocation property.
Dan
Re: How to create a mailto link?whats mistake in this Response.write "<A HREF = "mailto:&quo
am 26.09.2006 12:46:24 von Daniel Crichton
divya wrote on 26 Sep 2006 03:42:19 -0700:
> Hi Daniel and Evertjan
>
> Hey my problem is solved atlas ,but I still don't know the reason
> behind it.
>
> I replaced this line:-
> response.write "" &
> objrs("EMAIL") & ""
> with these lines:-
>
> Dim dbemail
> dbemail= objrs("EMAIL")
> response.write "" & dbemail &
> ""
> (Replaced second objrs("EMAIL") with dbemail )
> Now It displays properly all the emailaddresses with a mailto link.
> Even this works
> response.write "" &
> objrs("NAME") & ""
>
> where instead of second objrs("EMAIL") I used objrs("NAME")
>
> So when objrs("EMAIL") is used at both the places it doesnot give any
> output on the page.Can anybody explain the reason behind this
> behaviour????
Are you sure the mailto link has the email address in it? Did you actually
click it to check? I can see no reason why this would fix it, you're still
reading the EMAIL column twice. If the mailto link is just "mailto:" (which
I suspect it is) then replace the second objrs("EMAIL") with dbemail as
well.
Dan
Re: How to create a mailto link?whats mistake in this Response.write "<A HREF = "mailto:&quo
am 26.09.2006 13:01:30 von divya
Hiii Daniel,
I didnot read your second post before posting my third
post.Just now I read.Thanks Thanks a lot for the explaination.Yes you
are right I replaced even the other objrs("EMAIL") with dbemail .In my
code it just showed me the link but when I clicked it didnot work.Its
really nice of you,I was going mad behind it,Thanx a lot.
Cheers!!!
Divya
Daniel Crichton wrote:
> divya wrote on 26 Sep 2006 03:42:19 -0700:
>
> > Hi Daniel and Evertjan
> >
> > Hey my problem is solved atlas ,but I still don't know the reason
> > behind it.
> >
> > I replaced this line:-
> > response.write "" &
> > objrs("EMAIL") & ""
> > with these lines:-
> >
> > Dim dbemail
> > dbemail= objrs("EMAIL")
> > response.write "" & dbemail &
> > ""
> > (Replaced second objrs("EMAIL") with dbemail )
> > Now It displays properly all the emailaddresses with a mailto link.
> > Even this works
> > response.write "" &
> > objrs("NAME") & ""
> >
> > where instead of second objrs("EMAIL") I used objrs("NAME")
> >
> > So when objrs("EMAIL") is used at both the places it doesnot give any
> > output on the page.Can anybody explain the reason behind this
> > behaviour????
>
> Are you sure the mailto link has the email address in it? Did you actually
> click it to check? I can see no reason why this would fix it, you're still
> reading the EMAIL column twice. If the mailto link is just "mailto:" (which
> I suspect it is) then replace the second objrs("EMAIL") with dbemail as
> well.
>
> Dan