HTML: "send to a friend" link
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 开发者_Go百科e-mail should be already filled.
Subject: Website Name Body: Link to website, short description
is that possible ? thanks
<a href="mailto:enteryour@addresshere.com?subject=Website Name&body=Link to website, short description">Send me an email</a>
Is one way.
Using protocol mailto and GET parameters is correct, but you also have to use the urlencoded version for strings:
<a href="mailto:enteryour@addresshere.com?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.
<a href="mailto:myfriend@gmail.com?subject=Patrick's Website at patrickrules.com&body=<a href="http://www.patrickrules.com" title="Link to Patrick's Official Website">It's Patrick's Official Website!</a>">Send to a friend
<a href="mailto:s123@example.com?subject=Feedback for
webdevelopersnotes.com&body=Link to website, short description">Send to a friend</a>
Use <a href="mailto:..." />
.
Reference
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).
精彩评论