1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

"Invite a friend"

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

  1. liquidagoracom

    liquidagoracom New Member

    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

    What server side language you are using. Its not possible to do that using Plain HTML
     
  3. pradeep

    pradeep Team Leader

    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

    For a mailto link you can do without js as well.
     

Share This Page