Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help making Email field dynamic with mailto: 1

Status
Not open for further replies.
Apr 6, 2001
41
US
On this "Contact Info" page I have, I'm trying to make mailto work dynamically. FYI: This data is from an Access 2000 database that I'm calling up to a (.asp) "contact info" page (i.e.: name, address, telephone, email, etc). I need the email address column to be dynamic. Like a simple mailto with the email addresses brought in from the database. Here's the code on the page so far and it doesn't work. This code only blanks out the Email column...

<a href=&quot;mailto:<%=(rsContactMain.Fields.Item(&quot;Email&quot;).Value)%>&quot;><%=(rsContactMain.Fields.Item(&quot;Email&quot;).Value)%></a>

Hmmm, looks like it should work but it doesn't. Any good ideas?
 

Use this instead...


<a href=&quot;mailto:<%=rsContactMain.Fields(&quot;Email&quot;)%>&quot;><%=rsContactMain.Fields(&quot;Email&quot;)%></a>


Enjoy
B-)
Amiel
amielzz@netscape.net

 
Didn't work. With that code I get a &quot;page cannot be displayed.&quot; Can't believe I'm having so many problems with such an easy little task! AARGH! Guess I'm losing my mind.
smiletiniest.gif
Any more ideas, anyone?
 
There is nothing wrong with the statement. The error 'The page cannot be displayed' does not have anything to do with with the code above.

You need to check the HTML in the page. And you need to turn debugging on in IIS in order to get the information you need to identify the problems that occour while creating ASP pages.

Changing the VB Script statement above will not cause the page to display or not display; you may have failed to provide matching script tags around the block; this could cause the problem, or a missing <body> tag would cause it, an invalid connection string, an incorrect SQL statement, the list goes on.

If you had debugging turned on in IIS you would have gotten a consise description of the problem and the line number where it occoured. This is how creating an ASP page is typically done.

On the surface you have other problems with that page that go beyond this 'HREF' tag.

Later. Amiel
amielzz@netscape.net

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top