FORMMAIL or Form Handler

Discussion in 'HTML / PHP / JavaScript / CSS' started by medicbm, May 5, 2003.

  1. I would like to use some kind of form handler on my site so that I can email forms to multiple members at one time. I hva had no luck with the scripts I have found. Probobly because I am not sure what to do with them. Can anyone help????

    N Almeida
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    THis is a good one

    http://www.brainjar.com/asp/formmail

    Make sure you customize the script


    '- Customization of these values is required, see documentation. -----------

    referers = Array("www.brainjar.com", "brainjar.com")
    mailComp = "ASPMail"
    smtpServer = "localhost"
    fromAddr = "[email protected]"

    '- End required customization section. -------------------------------------


    quote:Originally posted by medicbm

    I would like to use some kind of form handler on my site so that I can email forms to multiple members at one time. I hva had no luck with the scripts I have found. Probobly because I am not sure what to do with them. Can anyone help????

    N Almeida
    </blockquote id="quote"></font id="quote">
     
  3. I went there, but like I think I mentioned before, I am pretty new at this and was not able to figure it out. I did download FormMail and wanted to try that. However, is askes for where the servers send mail is located....if that makes any sense. If any one knows of a good tutorial that cna help me figure this out that would be great

    N Almeida
     
  4. Bruce

    Bruce DiscountASP.NET Staff

    Try use localhost as your SMTP server

    quote:Originally posted by medicbm

    I went there, but like I think I mentioned before, I am pretty new at this and was not able to figure it out. I did download FormMail and wanted to try that. However, is askes for where the servers send mail is located....if that makes any sense. If any one knows of a good tutorial that cna help me figure this out that would be great

    N Almeida
    </blockquote id="quote"></font id="quote">
     
  5. quote:Originally posted by medicbm

    I would like to use some kind of form handler on my site so that I can email forms to multiple members at one time. I hva had no luck with the scripts I have found. Probobly because I am not sure what to do with them. Can anyone help????

    N Almeida
    </blockquote id="quote"></font id="quote">
     
  6. //** See below example //
    <form name="hw55" method="post" onsubmit="return Form_Validator(this)" action="http://www.fsamejim.net/cgi-bin/formmail.pl">

    // here, you can type multi e-mail //
    <input type="hidden" name="recipient" value="[email protected],[email protected],[email protected]; [email protected]; [email protected]" />
    <input type="hidden" name="subject" value="HW5 Checked" />
    <input type="hidden" name="redirect" value="http://www.fsamejim.com/xhtml" />

    ====================
    // full example


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>hw55</title>
    <link rev="made" title="Author's EMAIL" href="mailto:[email protected]" />
    <meta name="author" content="Fumiomi Samejima" />
    <meta name="keywords" content="QA, R&D, Sammy, fsamejim, form, FORM" />
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <meta http-equiv="content-style-type" content="text/css" />
    <style type="text/css">
    <!--
    a:link { color: "#000080"; }
    a:visited { color: "#80808"; }
    a:hover {
    cursor: e-resize;
    background-color : Yellow;}
    body {
    font-family: "Book Antiqua", "Times New Roman", "Times", serif;
    color: black;
    margin-left: 40px;
    margin-right: 40px}
    -->
    </style>
    <script language="JavaScript" type="text/JavaScript">
    <!---- hide script from older browsers
    function saySomething(message){
    alert(message)
    }
    // End hiding script from older browsers --->
    </script>


    <script language="JavaScript">
    // -----------------------------------------------------------------
    // Function : IsEmailValid
    // Language : JavaScript
    // Description : Checks if given email address is of valid syntax
    // Copyright : (c) 2000 Fumiomi Samejima
    // http://www.fsamejim.com/xhtml/hw5.html
    // -----------------------------------------------------------------
    // Ver Date Description of modification
    // --- ---------- --------------------------------------------------
    // 1.0 09/10/2000 Original write
    // -----------------------------------------------------------------
    // Source: Rice Consulting Service, Inc
    // (http://www.riceconsulting.com/training/exercises/default.htm)
    // Source: Webmonkey Code Library
    // (http://www.hotwired.com/webmonkey/javascript/code_library/)
    // -----------------------------------------------------------------

    function IsEmailValid(FormName,ElemName)
    {
    var EmailOk = true
    var Temp = document.forms[FormName].elements[ElemName]
    var AtSym = Temp.value.indexOf('@')
    var Period = Temp.value.lastIndexOf('.')
    var Space = Temp.value.indexOf(' ')
    var Length = Temp.value.length - 1 // Array is from 0 to length-1

    if ((AtSym < 1) || // '@' cannot be in first position
    (Period <= AtSym+1) || // Must be atleast one valid char btwn '@' and '.'
    (Period == Length ) || // Must be atleast one valid char after '.'
    (Space != -1)) // No empty spaces permitted
    {
    EmailOk = false
    alert('Please enter a valid e-mail address!')
    Temp.focus()
    }
    return EmailOk
    }
    </script>

    <script language="JavaScript">
    // -----------------------------------------------------------------
    // Function : Form_Validator
    // Language : JavaScript
    // Description : Checks if given text box has valid syntax
    // Copyright : (c) 2000 Fumiomi Samejima
    // http://www.fsamejim.com/xhtml/hw5.html
    // -----------------------------------------------------------------
    // Ver Date Description of modification
    // --- ---------- --------------------------------------------------
    // 1.0 09/10/2000 Original write
    // -----------------------------------------------------------------
    // Source: Rice Consulting Service, Inc
    // (http://www.riceconsulting.com/newsguest.htm)
    // -----------------------------------------------------------------
    function Form_Validator(theForm)
    {

    if (theForm.FirstName.value == "")
    {
    alert("Please enter a value for the \"FirstName\" field.");
    theForm.FirstName.focus();
    return (false);
    }

    if (theForm.LastName.value == "")
    {
    alert("Please enter a value for the \"LastName\" field.");
    theForm.LastName.focus();
    return (false);
    }

    if (theForm.Company.value == "")
    {
    alert("Please enter a value for the \"CompanyName\" field.");
    theForm.Company.focus();
    return (false);
    }

    if (theForm.email.value == "")
    {
    alert("Please enter a value for the \"E-mail\" field.");
    theForm.email.focus();
    return (false);
    }
    return (true);
    }
    </script>

    </head>


    <h5><a href="index.html">Go back to Previous Page</a></h5>
    Please give me feedback regarding my current status.
    <hr />

    <form name="hw55" method="post" onsubmit="return Form_Validator(this)" action="http://www.fsamejim.net/cgi-bin/formmail.pl">

    // here, you can type multi e-mail //
    <input type="hidden" name="recipient" value="[email protected],[email protected],[email protected]" />
    <input type="hidden" name="subject" value="HW5 Checked" />
    <input type="hidden" name="redirect" value="http://www.fsamejim.com/xhtml" />

    Company's Name:
    <input type="text" name="Company" value="" size="30" />
    <!--- varidate Company name --->

    Your First Name:<input type="text" name="FirstName" value="" size="20" />
    <!--- varidate First Name --->

    Your Last Name:<input type="text" name="LastName" value="" size="20" />
    <!--- varidate Last Name --->

    Your e-mail address:<input type="text" name="email" value="" size="30" />
    <!--- varidate email address --->


    Legality:<input type="text" name="Legality" disabled="disabled" value="This form assumes no responsibility, obligation or liability resulting from the use of the information contained herein." size="100" />



    Please check the following items that you like about me.

    My dog:<input type="checkbox" name="I like you because" value="your dog" checked="checked" />

    My personality:<input type="checkbox" name="I like you because" value="your personality" />

    My technical skills:<input type="checkbox" name="I like you because" value="your technical skills" />

    My way of thinking:<input type="checkbox" name="I like you because" value="your way of thinking" />



    Please chose the salary range for the job position.

    up to 60K:<input type="radio" name="Salary" value="up to 60K:" />

    60-90K:<input type="radio" name="Salary" value="60-90K:" checked="checked" />

    Above 90K:<input type="radio" name="Salary" value="above 90K:" />
    [b]
    [b]
    [b]
    Please chose the <em>"Option"</em> that reflects my current status.
    [b]
    <a name="option"></a>
    <select name="Your status:">
    <option value="I want to hire you">- I want to hire you -</option>
    <option value="Wait! Still in process">- Wait! Still in process -</option>
    <option value="You are dead">- You are dead -</option>
    </select>
    [b]
    [b]
    [b]
    Any Comments:
    [b]
    <textarea name="comment" rows="4" cols="60" wrap="soft"></textarea>
    [b]
    [b]
    [b]
    <input type="button" value="a button" onClick="saySomething('This button does nothing')" />
    [b]
    [b]
    <input type="button" value="go back" onClick="window.location='index.html';return false"/>
    [b]
    [b]
    <input type="submit" value="submit data" OnClick=IsEmailValid("hw55","email") />
    [b]
    [b]
    <input type="reset" value="reset data" />
    [b]
    [b]
    <hr />
    </form>
    <!-- Footer -->
    [b][b]
    <address>
    <a href="mailto:[email protected]">Fumiomi Samejima</a> at <a href="http://www.isd.net/fsamejim/resume/index.html" target="_blank">resume</a>
    [b]
    <script language="JavaScript" type="text/javascript">document.write("Last modified on " + document.lastModified)</script>
    </address>
    </body>
    </html>
    ----------
    [b]quote:[i]Originally posted by medicbm[/i]

    I would like to use some kind of form handler on my site so that I can email forms to multiple members at one time. I hva had no luck with the scripts I have found. Probobly because I am not sure what to do with them. Can anyone help????

    N Almeida
    </blockquote id="quote"></font id="quote">[/b][/b][/b][/b][/b][/b][/b][/b][/b][/b][/b][/b][/b][/b][/b][/b][/b][/b][/b][/b][/b][/b][/b]
     

Share This Page