tags:

views:

73

answers:

6

hi,

I need to add a "Send to a friend" link to my website.

When a user clicks on it, their e-mail software should open and the e-mail should be already filled.

Subject: Website Name Body: Link to website, short description

is that possible ? thanks

+2  A: 
<a href="mailto:[email protected]?subject=Website Name&body=Link to website, short description">Send me an email</a>

Is one way.

Tobiasopdenbrouw
uhm, why is my Safari visiting a new page instead of sending an email ? And Firefox just not doing anything ? I've just copied pasted your code. thanks
Patrick
Is this actually / still a problem?
Tobiasopdenbrouw
yeah this snippet doesn't work in my browsers
Patrick
From what I know, mailto shouldn't pose a problem in these browsers. Perhaps certain plug-/add-ins are causing the problem? And you could try Luc's comment (or sending something without spaces).
Tobiasopdenbrouw
+1  A: 
<a href="mailto:[email protected]?subject=Feedback for 
webdevelopersnotes.com&body=Link to website, short description">Send to a friend</a>
dejavu
Your Google-Fu is as strong as mine. :)
Tobiasopdenbrouw
A: 

Use <a href="mailto:..." />.

Reference

Brian S
+1  A: 
JohnB
+1 for funny AND functional.
Tobiasopdenbrouw
A: 

I think that you are going to need a simple form to allow people to enter there friends email address. php mail perhaps (just in case people don't have a email program).

ellisgeek
A: 

Using protocol mailto and GET parameters is correct, but you also have to use the urlencoded version for strings:

<a href="mailto:[email protected]?subject=Website+Name&body=Link+to+website%2C+short+description">Send me an email</a>

Spaces become "+" or "%20". PHP provides function urlencode() for this, python 2.x urllib.urlencode() of the urllib module, Perl has uri_escape of the URI::Escape package ... and so on.

Luc