How do I get this form to send an email.

How do I get this form to send a email:
<html>
<head>
</head>
<BODY>
<form method="GET"ACTION="thanks2.htm">

<p>What is your Employment Security Reference Number?&nbsp;<br>
<input type="text"name="esref"size="20">
</p>

<p>Contact Name:<br>
<input type="text"name="contact"size="20">
</p>

<p>Contact Phone:&nbsp;<br>
<input type="text"name="phone"size="20">
</p>

<p>Enter youre-mail address.<br>
<input type="text"name="submit_by"size="42"><font color="#FF0000"> (Required) </font>
</p>

<p>What electronic filing method are you using?<br>
<select size="1"name="version">
<option selected>--Select--</option>
<option>UIFast Tax</option>
<option>EPay</option>
<option>UIWeb Tax</option>
<option>ICESA WA</option>
</select><font color="#FF0000"> (Required) </font></p>

<p>What operating system are you running.&nbsp;<i><br>
(Right click on My Computer, go to the General tab)</i><br><select size="1"name="os">
<option selected>--Select--</option>
<option>Windows 95a</option>
<option>Windows 95b</option>
<option>Windows 98</option>
<option>Windows 98 SE</option>
<option>Windows NT4.0</option>
<option>Windows 2000</option>
<option>Windows ME</option>
<option>Windows XP(Professional)</option>
<option>Windows XP (Home)</option>
<option>Virtual PC (Macintosh)</option>
<option>Other Macintosh</option>
<option>Other OS</option>
</select><font color="#FF0000"> (Required)</font></p>

What type of problem are you experiencing?<BR><select size="1"name="problem">
<option selected>--Select--</option>
<option value="AmendingReport">Amending Report</option>
<option value="DigitalCertRequest">Digital Certificate Requested</option>
<option value="ErrorMessages">Error Messages</option>
<option value="GeneralQuestions">General Questions</option>
<option value="Importing">Importing</option>
<option value="Installation">Installation</option>
<option value="MovingDatatoanewMachine">Moving Data to a new Machine</option>
<option value="NetworkInstallation">Network Installation</option>
<option value="SendingReport">Sending Report</option>
<option value="TaxRates">Tax Rates</option>
<option value="ICESAWARelated">ICESA WA Related</option>
</select><font color="#FF0000"> (Required) </font>

<p>Please provide details about the problem<br>
<textarea rows="6" cols="39"name="comments"></textarea></p>
<p><input type="submit"value="Send to Technical Support"name="submit"><input type="reset"value="Reset"name="reset"></p>


<INPUT TYPE="HIDDEN" NAME="data_order"VALUE="esref,contact,phone,version,os,problem,comments,submit_by">
<INPUT TYPE="HIDDEN" NAME="required"VALUE="version,os,problem,submit_by">
<INPUT TYPE="HIDDEN" NAME="submit_to"VALUE="mailto:dyew@msn.com">
<INPUT TYPE="HIDDEN" NAME="automessage"VALUE="uiftsupport">
<INPUT TYPE="HIDDEN" NAME="form_id"VALUE="UIFastTax3.1TechnicalSupportRequest">
<INPUT TYPE="HIDDEN" NAME="ok_url"VALUE="/uitax/taxreportsandrates/electronicfiling/thanks2.php">
<INPUT TYPE="HIDDEN" NAME="not_ok_url"VALUE="http://www.dye-family.com/oops.html">

</form>
</BODY>
</HTML>
WDJ98338Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
serjikConnect With a Mentor Commented:
Just try this one:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<title>Form</title>
</head>
<body>
 
<?php 
if (isset($_POST['submit'])) {
 
  $to = $_POST['submit_to'];
  $from = $_POST['contact']; 
  $subj = '[Mail Subject]';
  $body = 'Form ID: ' . $_POST['form_id'] . '
 
What is your Employment Security Reference Number?
' .$_POST['esref'] . '
 
Contact Name:
' .$_POST['contact'] . '
 
Contact Phone:&nbsp;
' .$_POST['phone'] . '
 
Enter youre-mail address.
' .$_POST['submit_by'] . '
 
What electronic filing method are you using?
' .$_POST['version'] . '
 
What operating system are you running.
' .$_POST['os'] . '
 
What type of problem are you experiencing?
' .$_POST['problem'] . '
 
Please provide details about the problem
' .$_POST['comments'];
 
  // ---- mail function start
  function xmail($to,$from,$subj,$body) { 
    $boundary = md5(uniqid(time(),1)); 
    $add_header ="MIME-Version: 1.0\r\nContent-Type: multipart/mixed; boundary=\"$boundary\"";
    $mail_content = "--".$boundary."\r\n"
    ."Content-Type: text/plain; charset=utf-8; format=flowed\r\n"
    ."Content-Transfer-Encoding: 8bit\r\n\r\n"
    .$body;
 
    return mail($to,$subj,$mail_content,"From:".$from."\r\n".$add_header);
  }
// ---- mail function end
 
}
?>
 
<form method="post"action="thanks2.php">
  <p>What is your Employment Security Reference Number?&nbsp;<br />
    <input type="text" name="esref" size="20" /></p>
  <p>Contact Name:<br />
    <input type="text" name="contact" size="20" /></p>
  <p>Contact Phone:&nbsp;<br />
    <input type="text" name="phone" size="20" /></p>
  <p>Enter youre-mail address.<br />
    <input type="text" name="submit_by"size="42" /><font color="#FF0000">(Required)</font></p>
  <p>What electronic filing method are you using?<br />
    <select name="version">
      <option selected="selected">--Select--</option>
      <option>UIFast Tax</option>
      <option>EPay</option>
      <option>UIWeb Tax</option>
      <option>ICESA WA</option>
    </select>
    <font color="#f00">(Required)</font></p>
  <p>What operating system are you running.&nbsp;<i><br />
    (Right click on My Computer, go to the General tab)</i><br />
    <select name="os">
      <option selected="selected">--Select--</option>
      <option>Windows 95a</option>
      <option>Windows 95b</option>
      <option>Windows 98</option>
      <option>Windows 98 SE</option>
      <option>Windows NT4.0</option>
      <option>Windows 2000</option>
      <option>Windows ME</option>
      <option>Windows XP(Professional)</option>
      <option>Windows XP (Home)</option>
      <option>Virtual PC (Macintosh)</option>
      <option>Other Macintosh</option>
      <option>Other OS</option>
    </select>
    <font color="#f00"> (Required)</font></p>
  <p> What type of problem are you experiencing?<br />
    <select name="problem">
      <option selected="selected">--Select--</option>
      <option value="AmendingReport">Amending Report</option>
      <option value="DigitalCertRequest">Digital Certificate Requested</option>
      <option value="ErrorMessages">Error Messages</option>
      <option value="GeneralQuestions">General Questions</option>
      <option value="Importing">Importing</option>
      <option value="Installation">Installation</option>
      <option value="MovingDatatoanewMachine">Moving Data to a new Machine</option>
      <option value="NetworkInstallation">Network Installation</option>
      <option value="SendingReport">Sending Report</option>
      <option value="TaxRates">Tax Rates</option>
      <option value="ICESAWARelated">ICESA WA Related</option>
    </select>
    <font color="#f00">(Required)</font></p>
  <p>Please provide details about the problem<br />
    <textarea rows="6" cols="39" name="comments"></textarea></p>
  <p><input type="submit" value="Send to Technical Support" name="submit" /><input type="reset"value="Reset"name="reset" /></p>
  <input type="hidden" name="data_order" value="esref,contact,phone,version,os,problem,comments,submit_by" /> <input type="hidden" name="required" value="version,os,problem,submit_by" /> <input type="hidden" name="submit_to" value="mailto:dyew@msn.com" /> <input type="hidden" name="automessage" value="uiftsupport" /> <input type="hidden" name="form_id" value="UIFastTax3.1TechnicalSupportRequest" /> <input type="hidden" name="ok_url" value="/uitax/taxreportsandrates/electronicfiling/thanks2.php" /> <input type="hidden" name="not_ok_url" value="http://www.dye-family.com/oops.html" />
</form>
</body>
</html>

Open in new window

0
 
hieloConnect With a Mentor Commented:
The email is sent from the web server, not from the browser. When the form is submitted, the data will be sent to your web server, specifically to thanks2.htm:
<form method="GET"ACTION="thanks2.htm">

Typically, web servers are not configured so that htm files process form data. What you need to do is find out what server side techonology you have available for processing the form data (PHP,ASP,Perl,etc). Once you find out what is your available technology, you need to change your ACTION attribute on the form above so that it points to your processing script. For the sake of argument, let's say you have ASP available. So, you <form> tag would look as follows:
<form method="GET"ACTION="thanks2.asp">

Then on thanks2.asp you need to write the necessary code to process the data sent to it and then email it to whomever. It is not clear what server side scripting technology you have available to send the email, so depending on what you have, you may want to look at these:
Perl:
http://www.perlfect.com/articles/sendmail.shtml

PHP:
http://us.php.net/function.mail

ASP:
http://w3schools.com/asp/asp_send_email.asp
0
 
WDJ98338Author Commented:
Thanks
0
 
WDJ98338Author Commented:
Thanks for your help.
0
All Courses

From novice to tech pro — start learning today.