How do I add an "email to a friend" feature to my site...

Discussion in 'HTML & Website Design' started by Tabs, Oct 9, 2006.

  1. #1
    I have an article site and need to know how to add an "Email this page to a friend" feature to my site where do I go to get this service or is it something I can do with frontpage?

    PS
    What would it be called "a plug in"?

    Thanks for your help :)
     
    Tabs, Oct 9, 2006 IP
  2. knightyme

    knightyme Peon

    Messages:
    59
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hmmmm...since it sounds like you want to keep it relatively simple, I took the liberty of including the javascript version below....

    place the following code anywhere between your <body></body> tags.

    <script type="text/javascript">
    <!--
    function e_friend(e_add,subject1)
    {
    if ((subject1=="") || (subject1==null))
    subject="Hi!";
    window.location="mailto:"+e_add+"?subject="+subject1;
    }
    //-->
    </script>
    <p>
    Fill out the e-mail address and subject to e-mail a friend:
    </p>
    <p></p>
    <div>
    <form name="e_form" id="e_form" action="#">
    <div>
    <input type="text" name="emadd" id="emadd" size="30" />
    <br />
    <input type="text" name="subj" id="subj" size="30" />
    <p></p>
    <input type="button" value="Send E-mail" onClick="e_friend(this.form.emadd.value,this.form.subj.value)" />
    </div>
    </form>
    </div>



    then, to 'call' the code into a visible form, place the following code snippet on your site, where you wish for the e-mail this site to a friend to appear.....

    <a href="javascript:e_friend()">Email a Friend!</a>

    That should do it! ;)
     
    knightyme, Oct 9, 2006 IP
  3. DarkAge

    DarkAge Active Member

    Messages:
    353
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    58
    #3
    you probably want the server to send the email out on your members behalf.

    This way you can set the "from" email address to be your members email address.

    Beware of email injection though !

    Do a search on google, many examples there...
     
    DarkAge, Oct 10, 2006 IP
  4. Ibn Juferi

    Ibn Juferi Prominent Member

    Messages:
    6,221
    Likes Received:
    365
    Best Answers:
    0
    Trophy Points:
    310
    #4
    Hmm...a PHP script could do the job.

    - MENJ
     
    Ibn Juferi, Oct 10, 2006 IP