Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Jun 2006
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Java email script

    Good morning to all, I need a script that I could use to send an email from the user to my personal email account. Basically I want the user to fill out a series of text boxes, name, message, subject and then once the user clicks the submit button the information will be sent to me via email from the site.

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,992
    Thanks
    203
    Thanked 2,536 Times in 2,514 Posts
    You need a server-side script such as formmail.pl for that. The best that JavaScript can do is validate the content of your textboxes before the form is submitted.

  • #3
    Regular Coder
    Join Date
    May 2007
    Posts
    118
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi bsharif, you need ASP or PHP script to do that, or you can use form with mailto target, but that is not the best solution.

    Code:
    <form method="post" action="mailto:info@dot.com">
    Name: <input type="text" size="10" maxlength="40" name="name"> <br />
    Subject: <input type="text" size="10" maxlength="10" name="subject"><br />
    <textarea name="message"></textarea><br />
    <input type="submit" value="Send"> 
    </form>
    Last edited by smalldog; 05-18-2007 at 03:56 PM.
    Forum for webmasters and developers
    http://www.htmlfrenzy.com
    Are you an IT expert? Join our Reward system
    www.htmlfrenzy.com/reward-system.php

  • #4
    New Coder
    Join Date
    Jun 2006
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by smalldog View Post
    Hi bsharif, you need ASP or PHP script to do that, or you can use form with mailto target, but that is not the best solution.

    Code:
    <form method="post" action="mailto:info@dot.com">
    Name: <input type="text" size="10" maxlength="40" name="name"> <br />
    Subject: <input type="text" size="10" maxlength="10" name="subject"><br />
    <textarea name="message"></textarea><br />
    <input type="submit" value="Send"> 
    </form>

    Thanks for the code , If I were to do it in Asp/php could you give me the code for that?

  • #5
    New Coder
    Join Date
    Jun 2006
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Philip M View Post
    You need a server-side script such as formmail.pl for that. The best that JavaScript can do is validate the content of your textboxes before the form is submitted.
    Your right, didn't even think about this!

  • #6
    Regular Coder
    Join Date
    May 2007
    Posts
    118
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Forum for webmasters and developers
    http://www.htmlfrenzy.com
    Are you an IT expert? Join our Reward system
    www.htmlfrenzy.com/reward-system.php

  • #7
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,992
    Thanks
    203
    Thanked 2,536 Times in 2,514 Posts
    As I say, mailto: is very unreliable for several reasons and is not recommended. Using mailto: with forms produces inconsistent results in different browsers. Some will send the form directly. Some will open the associated default email program and ignore the form content completely. If there is no email program then the form will be completely non-functional. (Internet cafes, libraries etc will normally only allow web access and not email).

    Use a server-side script (Perl or PHP) if you want it to work in all browsers.

  • #8
    New Coder
    Join Date
    Jun 2006
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by smalldog View Post
    ^^ Thanks


  •  

    Posting Permissions

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