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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hyperlink email address not working 2

Status
Not open for further replies.

MarcusStringer

IS-IT--Management
Sep 11, 2003
1,407
0
0
AU
Hi Guys,
I have a form on my website which requests a quote... (.ASP)

It then, upon submitting, sends the form via HTML email to the relevant person.


Picture1-11.png


Picture2-3.png


What this person is asking for is to have the "emailcontact" information hyperlinked in the eventual email...

so they can simply click on the link to reply via the email address supplied under the "emailcontact" variable...

I can't get it to work using the
<a href=mailto:"emailcontact" line
Hope that makes sence?

Marcus
 
I can't get it to work using the
<a href=mailto:"emailcontact" line
If that's actually what you've put, it needs to be
Code:
<a href="mailto:emailcontact@example.com">emailcontact@example.com</a>
i.e. the mailto: bit goes inside the quotes, not outside.

If that's not what you've put, maybe you could cut and paste the HTML you've actually generated (not the ASP that builds it) and we'll see what's wrong.



-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Code:
<td><a href="mailto:&request.form("emailcontact")&">"&request.form("emailcontact")&"</a>""</td>"

It needs to be a variable (emailcontact) like in the top picture so when the HTML email arrives that variable (emailcontact) is hyperlinked

Marcus
 
This looks like an ASP syntax problem, rather than an HTML problem. Try forum333

If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
You have two double quotes between </a> and </td>, which I think should not be there. Other than that, I think it looks good.

I stand by my initial thought that you should output this text to the browser to see if email client is doing something to the hyperlinks.

[small]Do something about world cancer today: Comprehensive cancer control information at PACT[/small]
 
The crappy thing about VBscript is that it doesn't handle escape characters very well, so using double quotes is a bit of a pain.

This should solve it for you:

Code:
bodytext = bodytext & "<tr>"
bodytext = bodytext & "<td>Email Contact: </td>"
bodytext = bodytext & "<td><a href=""mailto:" & request.form("emailcontact") & """>" & request.form("emailcontact") & "</a></td>"
bodytext = bodytext & "</tr>"


--------
GOOGLE is a great resource to find answers to questions like "how do i..."

If you don't know exaclty what you want to do or what to search on, try Google Suggest: --------
I have recently been semi-converted to ensuring all my code (well most of it) works in both javascript and non-javasc
 
It looks like you've fixed the problem, but I'll repeat what I said above:
cut and paste the HTML you've actually generated (not the ASP that builds it)
If you only look at the ASP and assume that it's coming out right, you're gonna have plenty more problems like this.

Run your program, then do a "view source" on the result - then you'll know if you're generating the HTML you think you're generating.

What the difference between double and single quotes?
In HTML, there's no difference - you can use either. It can be handy to use one sort of quote when the value it's enclosing includes the other sort. What difference there might be in ASP I couldn't say.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
MarcusStringer (IS/IT--Management) 23 Aug 09 19:47 said:
What the difference between double and single quotes?

In ASP (VBScript) a single quote defines a comment, wereas a double quote defines a string.

two double quotes work like an escape char in most other languages...

i.e.

JavaScript:
document.write("hello \"marcus\"");

Code:
response.write "hello ""marcus"""

It's a lot harder to read in vbscript, especially if you are adding variables to the output.

--------
GOOGLE is a great resource to find answers to questions like "how do i..."

If you don't know exaclty what you want to do or what to search on, try Google Suggest: --------
I have recently been semi-converted to ensuring all my code (well most of it) works in both javascript and non-javasc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top