PDA

View Full Version : Mailto Alternate Text


JoeP
11-12-2002, 01:34 AM
The code below is a nice little function to let a visitor send the link of my page to a friend. What I would appreciate is someone to show me a way I can modify the script so the message in the body would give alternate text instead of the page url address; in other words, instead of the Body message having: "location.href;" which is the actual URL i.e. http//www etc. I would like to have an alternate text link such as: "This Cool Page!" The recipient of the email would see and click on.

Any suggestions and/or advice will be appreciated.

Thank You!



<script language="javascript">
function mailpage()
{
mail_str = "mailto:?subject=" + document.title;
mail_str += "&body= I Thought You May Be Interested With This Page. It Is Located On This WebPage : " + document.title;
mail_str += ". Visit " + location.href;
location.href = mail_str;
}
</script>



<a href="javascript:mailpage()"><font face="Arial Narrow" size="2">Share This Page With A Friend.</font></a>
:thumbsup:

beetle
11-12-2002, 04:49 AM
I'm not 100% sure on this but 99% sure. To send an email like that, it needs to be an HTML email, and to send an HTML email you need to set the MIME header, and to set the MIME header you need a server-side language (read: not javascript or HTML)

Got PHP or ASP or something like that at your disposal?

JoeP
11-12-2002, 01:18 PM
I have ASP.

beetle
11-12-2002, 01:25 PM
http://www.hotscripts.com/ASP/Scripts_and_Components/Form_Processors/

JoeP
11-12-2002, 04:19 PM
Thx for the link. I was afraid I would have to build the Form like most of the examples... :( So Be it!

whammy
11-12-2002, 10:58 PM
Another great link:

http://www.aspfaqs.com/aspfaqs/ShowCategory.asp?CatID=10

:)

JoeP
11-13-2002, 02:57 AM
Thx! Whammy, as usual, always there!

Link is great!