Forum Moderators: open
I've been trying to solve a problem I have with attaching the url of a current page into the body of an e-mail.
I wish to trigger the mail program (default) with the mailto tag when a user is sending the page to a friend.
It would look something like this I think:
<a href="mailto:someone@somedomain.com?subject=my%20subject&body=http://the url of this page">mail this link to a friend</a>
I appreciate any suggestions
thx zr
<a href="mailto:someone@somedomain.com?subject=my%20subject&body=http://mydomain.com/thispage.html">mail this link to a friend</a>
Javascript:
<script ... >
document.write('<a href="mailto:someone@somedomain.com?subject=my%20subject&body='+top.location.href+'">mail this link to a friend</a>');
</script>
PHP:
<a href="mailto:someone@somedomain.com?subject=my%20subject&body=http://<?=$HTTP_HOST.$PHP_SELF?>">mail this link to a friend</a>
Because there is no pure HTML solution, I'd suggest working out this issue in our Javascript forum, or our either one of our PHP forum / Perl CGI script forums for a server side answer.
Also, there are many free scripts available around the web to help you do this - so you don't need to start from scratch. Try a Google search on email friend script or a related search phrase that includes the scripting technology you want to use.