HTML Question

I want to include an email link on the pages of our company’s website, that includes the URL of the page from which it was “sent” as the subject of the email - I get all the “webmaster” queries and it would be very useful to know where the user was when they encountered the problem that they wish to bring to my attention.

I know the <mailto> tag, and how to use …?subject=blahblah… but is there a way to get it to include the page URL (or failing that, the page title) in the subject header?

Thanks

Gp

There might be a way to do directly what you want.

You may also be able to do it with a “send email” form, where a hidden field is the URL of that page.

Since the URL is created for each page separately, why not just include the page identifier in the mailto: URL? For example:

<a href=“mailto:?to=joe@xyz.com&cc=bob@xyz.com&body=error%20at%20index.html”>Problems with this page? Let me know.</a>

In this case, the words “error at index.html” should be put in the message’s body.

CurtC, that’s a neat trick, but it won’t work with all browser/e-mail program combinations.

I would do this kind of thing with a form and hidden fields. You wouldn’t even need a hidden field to get the refering page as HTTP_REFERER is an environment variable.

<script language=“JavaScript”>
document.write("<a href="mailto:email@domain.com?subject=" + document.location + “”>e-mail me</a>");
</script>

PaulYeah

Thanks for the responses - I am using Dreamweaver to create the pages and use a Library item to create a “Click here to email Webmaster” link at the bottom of each page. What I was hoping for was a way that would automatically include the URL/title of each page in that email - i.e. so I don’t have to type it in each time…

Paul, would your Javascript work in a library item?

Lance I haven’t had much success with forms - but it is worth a try…

Gp

grimpixie, I haven’t used DreamWeaver, so I don’t have a specific answer to that. It would probably be easier to just open the page in a plain text editor (Notepad, SimpleText, etc.) and paste the code in.

If you have the URL for the page, I’d be glad to paste the code in and e-mail it to you.

PaulYeah

Paul - Thanks for the offer - If you could make me a sample with email “webmaster@rcvs.org.uk” and URL “http://www.rcvs.org.uk/index.html” then I’ll adapt for the rest of the site…

Email it to webmaster…

Gp