It's quite simple to display an Email link for sending a page or a link to someone else:
<a href="mailto:?subject=Web Address&body=This might interest you: http://www.bme.ie">Send BME Web Address to a Friend</a>
mailto: protocol is used. This simply starts the user's Email client program with the given parameters for the Email
subject and the Email
body. Since there is no web address for the recipient specified between
?, the user can fill this in (e.g., with some address from her/his address book).
var sSubject = 'Interesting Web Page';
var sBody = 'Hi,\\n\\nthis might interest you:\\n' + location.href;
var sDisplay = 'Send this Page to a Friend';
+ '?subject=' + escape(sSubject)
+ '&body=' + escape(sBody)
+ '">' + sDisplay + '</a>'
In the code above, the
sSubject (subject) and
sBody (body) variables/parameters are encoded with the
escape function to allow for special characters such as newlines to be used without problems.
Send BME Website Link to a Friend