Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Jun 2003
    Location
    Kearney, Nebraska, USA
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Send e-mail using client side Java script

    Does anyone know how to send an e-mail with form information using client-side java script? I know this is sort of a strange questions but it's for a class I'm taking and we can't use any server side scripting. Any information, web sites, etc. would be helpful at this point!

    Many thanks,
    Shane

  2. #2
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Send e-mail using client side Java script

    You can post a form to an email address, although I haven't done this for years... I don't remember the details, such as whether you need to set SMTP server details or not.

    Although you will never have the flexibility of Server-side scripting, you can use the method mentioned above like this:

    < form action="YourEmail@YourDomain.com" method="post" >

    As for a javascript method, I'm not aware of anything that would be easy to use. Maybe another lounger will have a suggestion for this.

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Send e-mail using client side Java script

    You could dynamically build a mailto link with JavaScript, and then use JavaScript to "click" it (have I done that, or was I clicking a button?), but otherwise you have to know a huge amount about the mail facilities of the server...

    (Looking up code...)

    I made a page with radio buttons, the user chose one and this automatically submitted the form with that option. The code for one of the radio buttons was:

    <input type="radio" name="SearchType" value="CODE" onclick="java script:SearchSubmit.click();">Exact client code

    SearchSubmit is the NAME attribute of the Submit button. I wonder... could you send a click event to a mailto link?

    Look forward to seeing your progress on this.

  4. #4
    New Lounger
    Join Date
    Jun 2003
    Location
    Kearney, Nebraska, USA
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Send e-mail using client side Java script

    Many thanks to both of you. I'll give it a try and see what I can come up with.

    Thanks,
    freemans

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •