SitePoint Sponsor

User Tag List

Results 1 to 13 of 13
  1. #1
    Not a post-script error?!! guysmy's Avatar
    Join Date
    Sep 2001
    Location
    Underneath the Earth w/ Krom (Canada)
    Posts
    787
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Forms to E-mail -- HELP!

    I need to develop a little form for a client's site I'm working on. What I need to be able to do is some how get the info e-mailed to the client when someone fills the thing out. (I use Dreamweaver)

    I attempted to mail the info without processing it via a CGI script and what I got was a blank e-mail with an attached .ATT file (Windows). On the Mac side it didn't even send me the e-mail.

    --

    What is the simplest way to e-mail information from a form?

  2. #2
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The simplest way is this:
    Code:
    <form method="post" action="mailto:you@whatever.com" enctype="text/plain">
    The best way would probably be to use a CGI program (either Perl, PHP, ASP, whatever). I say this because if you use the other method, the person filling out the form needs to have an email client set up on their machine, which isn't always possible on public or shared computers.

  3. #3
    Not a post-script error?!! guysmy's Avatar
    Join Date
    Sep 2001
    Location
    Underneath the Earth w/ Krom (Canada)
    Posts
    787
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1) Does anyone suggest a specific CGI script? (free)
    2) How can I change the subject of the e-mail?

  4. #4
    SitePoint Wizard johntabita's Avatar
    Join Date
    Mar 2001
    Location
    In a big, big house, with lotsa lotsa room
    Posts
    1,062
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    A popular (free) script is available at:

    http://worldwidemart.com/scripts/formmail.shtml

    Changing the subject is addressed in the ReadMe file.

  5. #5
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  6. #6
    Not a post-script error?!! guysmy's Avatar
    Join Date
    Sep 2001
    Location
    Underneath the Earth w/ Krom (Canada)
    Posts
    787
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Looks like a nice article, but I'm using Mac OS 9, so I can't use PHP.

    I used the "simple" method posted by mattjacob, but for some reason I cannot SEND the form in IE 5 for the Mac. (connection error) I tryed submitting the form on my PC at home and a popup message prompted me, which allows you to change the subject line of the e-mail. I clicked on SEND and bingo. It worked fine on the PC. Why doesn't it work cross platform?

  7. #7
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The catch with using e-mail forms is that your system needs to have an e-mail client which is properly installed and configured before you can submit any data.

  8. #8
    SitePoint Enthusiast
    Join Date
    May 2002
    Location
    Westborough, Massachusetts
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by guysmy
    1) Does anyone suggest a specific CGI script? (free)
    2) How can I change the subject of the e-mail?
    Johntabita is right! FormMail is so popular that just about every ISP I've ever encountered already has it available for you. Just e-mail your tech support and tell them you want FormMail in a CGI directory on your site and ask them for the path to PERL.

    The rest is simple:

    Code:
    <form method="POST" action="http://www.yoursite.com/cgi-bin/formmail.pl">
    <!--This line tells the server what to do-->
    <input type="hidden" name="recipient" value="youremail@whatever.com">
    <!--This line tells the server every email address to send the input to-->
    <input type="hidden" name="subject" value="PutYourSubjectHere">
    <!--This is where you can enter a subject-->
    <input type="hidden" name="required" value="realname, email">
    <!--This makes these two fields required fields-->
    <input type="hidden" name="print_config" value="realname, email">
    <!--This puts these two fields in the header of the email and in the body also-->
    <input type=hidden name="redirect" value="http://www.yoursite.com/thankyou.shtml">
    <!--This redirects the browser to another page after they press the submit button-->
    <input type=hidden name="print_blank_fields" value="1">
    <!--This forces fields to be included in email even when there's no info in them-->
    Hope this helps
    "Living life in the fun lane!"

  9. #9
    Grumpy Mole Man Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,067
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    FormMail is also extremely badly written and very insecure. For an alternative that does exactly the same thing but was written by Perl experts who really know what they are doing see here:

    http://nms-cgi.sourceforge.net/

  10. #10
    SitePoint Enthusiast
    Join Date
    May 2002
    Location
    Westborough, Massachusetts
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Skunk
    FormMail is also extremely badly written and very insecure. For an alternative that does exactly the same thing but was written by Perl experts who really know what they are doing see here:

    http://nms-cgi.sourceforge.net/
    Thanks for the headsup. I just downloaded a few of the scripts and I'm gonna check them out.

    One stupid question though. And I hope I'm using the "correct" word to get the correct answer. How do I get a guestbook script result to "resolve" into a particular page design or template? Does that make any sense?
    "Living life in the fun lane!"

  11. #11
    Grumpy Mole Man Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,067
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It depends on the guestbook script, but most (almost all I would have thought) will allow you to specify a basic template with at least a customisable header and footer for the guestbook page. You add your HTML to those template files and off you go. Some scripts may require you to create your own template and include the guestbook output in to it via SSI (provided your web server supports it).

  12. #12
    SitePoint Enthusiast
    Join Date
    May 2002
    Location
    Westborough, Massachusetts
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks! I suppose I should read the docs and look through the files BEFORE I start asking questions!
    "Living life in the fun lane!"

  13. #13
    SitePoint Member
    Join Date
    Feb 2002
    Location
    Hollywood, FL, USA
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Forms to E-mail -- HELP!

    Originally posted by guysmy
    [B]I need to develop a little form for a client's site I'm working on. What I need to be able to do is some how get the info e-mailed to the client when someone fills the thing out. (I use Dreamweaver)
    We do custom form mailers for people very cheaply. Drop me a line if you like.
    William Cross
    http://fallendomains.com Expireds anyone?
    http://perlcoders.com CGI Superstore.
    http://webedpro.com WYSIWYG Heaven.


Bookmarks

Posting Permissions

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