"Invite a friend"

Discussion in 'JavaScript and AJAX' started by liquidagoracom, Oct 26, 2007.

  1. liquidagoracom

    liquidagoracom New Member

    Joined:
    Oct 26, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    I need to put a form in my website www.liquidagora.com where people can enter a friend's email and automatically the site sends an email to that person.


    I don't even know how is that called, So I couldn't search here on the forum.

    I'd appreciate any resource with a code to do that.



    Thank you very much

    Luiz
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,345
    Likes Received:
    382
    Trophy Points:
    83
    What server side language you are using. Its not possible to do that using Plain HTML
     
  3. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,645
    Likes Received:
    87
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    http://blog.pradeep.net.in
    A simple solution to the problem would be to put a mailto: link in your page, using a bit of javascript!

    HTML:
    <script language='JavaScript'>
    function doEmail()
    {
    	var email = document.getElementById('email').value;
    	var uri = 'mailto:'+email+'?Subject=Check this out&Body=Check out http://go4expert.com';
    	document.getElementById('ifr').innerHTML = '<iframe src="'+uri+'"></iframe>';
    }
    </script>
    <input type="text" name="email" id="email"> <input type="button" value="Send To Friend" onClick="doEmail();">
    <span id='ifr' style='display:none'></span>
    
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,345
    Likes Received:
    382
    Trophy Points:
    83
    For a mailto link you can do without js as well.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice