homepage Welcome to WebmasterWorld Guest from 54.234.147.84
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
Attach current url of the page with mailto() tag
yoo_daa




msg:592221
 6:20 pm on Oct 20, 2004 (gmt 0)

Greetings all,

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

 

StupidScript




msg:592222
 8:58 pm on Oct 20, 2004 (gmt 0)

HTML:

<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>

tedster




msg:592223
 11:13 pm on Oct 20, 2004 (gmt 0)

You need to grab the url of the current page with Javascript on the client-side or a server-side script of some kind. Either that, or hand code it into each page. Then there is also the issue of how the recipient's email address gets into the mesaage and whether you want a record of that or not.

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.

yoo_daa




msg:592224
 11:12 am on Oct 21, 2004 (gmt 0)

Thanks guys,

I'll try it and come back to you..!

zr

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved