I normally hand code a unique query string for each link and use that value as the email's subject. However, it is sometimes useful to see the full url - then, in the email client, you can just click on the link to see the page. It is also useful for tracking people who request your feedback page without actually clicking on one of your links - think spammers.
This page discusses an automatic method of obtaining using the Microsoft ASP Request.ServerVariables.
ASP Request Object
Any time an HTTP request is made, the data that the server receives is made availble to your program via the Request object. I have found the following 3 collections to be useful
However, be aware that this data can be faked by malicious users. You should not trust any of it for email addresses, query strings, and the like.Because these are collections (a type of array), you can write programs to see what the collection contains. Microsoft provides following code as an example.
|
|
Example Output
Server Variable | Value |
HTTP_HOST | mc-computing.com |
HTTP_REFERER | http://mc-computing.com/Test.html |
HTTP_USER_AGENT | Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322) |