• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 197
  • Last Modified:

How do I send the results of this form to a selected email recipient?

I have the following form in FrontPage 2003.  You can see that I have a short dropdown list of recipients. I would like the user to enter information, then select one of the options, and click send to email the information.  I have heard that SendMail is limited to 256 characters.  That won't do.

I don't know what my ISP provides for scripting tools, so the simpler the better for a knothead like me.

Here's the form as it currently stands.  Thanks in advance.

<HTML>
<HEAD>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-us">
<TITLE>Cell Leader Minutes</TITLE>
<meta name="Microsoft Theme" content="rmnsque 1011">
</HEAD>
<BODY>
<h1>Cell Leader Minutes</h1>
<HR>
<P>
Use this form to email cell meeting minutes to your zone supervisor.&nbsp; After
entering all the information, be sure to select the recipient and click the Send
button.</P>
<form method="post" name="form" action="">
<hl></hl>
<INPUT TYPE="hidden" NAME="subject" VALUE="Cell Leader Minutes">
<P>
Cell Leader Name:&nbsp;&nbsp;&nbsp;&nbsp;
<INPUT TYPE=TEXT NAME="leader" SIZE=50 MAXLENGTH=50>
</P>
<P>Intern Name:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<INPUT TYPE=TEXT NAME="intern" SIZE=50 MAXLENGTH=50>
<BR>
</P>
<P>
Meeting Date:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<INPUT TYPE=TEXT NAME="meetingdate" SIZE=8 MAXLENGTH=8>
<em>&nbsp; (mm/dd/yy)</em><BR>
</P>
<P>
Meeting Location:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<INPUT TYPE=TEXT NAME="location" SIZE=50 MAXLENGTH=50>
<BR>
</P>
<P>
Time Began:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<INPUT TYPE=TEXT NAME="began" SIZE=12 MAXLENGTH=12>
<EM> &nbsp; </EM></P>
<P>
Time Ended:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<INPUT TYPE=TEXT NAME="ended" SIZE=12 MAXLENGTH=12>
</P>
<P>
Attendance:
(enter names)<BR>
<TEXTAREA NAME="attendance" ROWS=9 COLS=109></TEXTAREA>
<BR>
</P>
<P>
# Members Attended:&nbsp;
<INPUT TYPE=TEXT NAME="members" SIZE=5 MAXLENGTH=5>
<BR>
</P>
<P>
# Guests:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<INPUT TYPE=TEXT NAME="guests" SIZE=5 MAXLENGTH=5>
<BR>
</P>
<P>
Comments / Important Points:
<BR>
<TEXTAREA NAME="comments" ROWS=5 COLS=109></TEXTAREA>
<br>
<BR>
</P>
Please select your Zone Supervisor from the dropdown list below and click Send.<br>
<SELECT Name="MailAddresses">
<option value="bob@cycominc.com">Bob
<option value="bjones@omnidevelopments.com">BJones
<option value="name3@bla.com">Lee
</SELECT>

<input type="button" value="Send Mail" onClick="SendMail()">

<p>&nbsp;</p>
</p>
<HR>
<H5>
Author: Bob Jones <br>Copyright © 2004 WCG Lexington. All rights reserved. <BR>
Revised:
<!--WEBBOT BOT=TimeStamp
    S-Type="EDITED"
    S-Format="%m/%d/%y"
--></H5>
<input type=hidden name="body" value=document.frmMail.comments>
<script>
function SendMail() {
  strMailAddress = "mailto:" + document.frmMail.MailAddresses.options[document.frmMail.MailAddresses.selectedIndex].value;
  document.frmMail.action = strMailAddress;
  document.frmMail.submit();
}
</script>
</FORM>
</BODY>
</HTML>
0
bjones8888
Asked:
bjones8888
  • 4
  • 2
1 Solution
 
surajgupthaCommented:
I guess that you might need to change

<form method="post" name="form" action="">
to
<form method="post" name="frmMail" action="">

for the current form to work.
0
 
ellandrdCommented:
plus use some scripting language like PHP and use the mail() functoin....

if your not sure but php, ill do an example for you

cheers

sean
0
 
surajgupthaCommented:
If u intend to use server side coding. You might not need to send a mail. YOu can store the data directly into the database. Just a thought.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
bjones8888Author Commented:
I don't have a database installed, nor do I need one.  I'm told that I have available ASP (not ASP.NET), and could install some type of PHP interpreter.  All new to me.
0
 
ellandrdCommented:
Hi

Yes you can install IIS (comes with windows - look in Control Panel > Add/Remove Programs > Add/Remove Windows Components and look for IIS Installation Box and tick it, then follow the instructions...)

To use IIS for ASP scripts on localhost is simple, create a folder in wwwroot for example and save all your .asp webpages/files in there.

e.g. --> http://localhost/somedirectory/somepage.asp

To use IIS for PHP scripts on localhost is simple too, create another folder in wwwroot for example again and save all your .php webpages/files in there too.

Then search Google for a PHP installer.  Download the installer (I used PHP4) and follow onscreen instructions, its simple to use and install. it will configure everything for you so dont worry!

Ive searched for PHP installer for you and you'll find one at

http://uk.php.net/get/php-4.3.9-installer.exe/from/a/mirror

Thats it, you've now got ASP & PHP set up and run your scripts but DONT forgot that PHP is Serverside scripting language and ASP is Clientside like JavaScript.

If you want to send your form details to Database, i'd use an Access Database for both ASP and PHP even though alot of Webmaster/Programmers will use SQL for PHP.

If you require example for this, let me know! post question or mail --> sticks.delaney@gmail.com

Above your first question, there is an example using your form.html and my form.php and send a email to a recipient...

########### (your form) form.html ###########
<HTML>
<HEAD>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-us">
<TITLE>Cell Leader Minutes</TITLE>
<meta name="Microsoft Theme" content="rmnsque 1011">
</HEAD>
<BODY>
<h1>Cell Leader Minutes</h1>
<HR>
<P>
Use this form to email cell meeting minutes to your zone supervisor.&nbsp; After
entering all the information, be sure to select the recipient and click the Send
button.</P>
<form method="POST" name="form" action="form.php">
<hl></hl>
<INPUT TYPE="hidden" NAME="subject" VALUE="Cell Leader Minutes">
<P>
Cell Leader Name:&nbsp;&nbsp;&nbsp;&nbsp;
<INPUT TYPE=TEXT NAME="leader" SIZE=50 VALUE="" MAXLENGTH=50>
</P>
<P>Intern Name:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<INPUT TYPE=TEXT NAME="intern" SIZE=50 VALUE="" MAXLENGTH=50>
<BR>
</P>
<P>
Meeting Date:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<INPUT TYPE=TEXT NAME="meetingdate" SIZE=8 VALUE="" MAXLENGTH=8>
<em>&nbsp; (mm/dd/yy)</em><BR>
</P>
<P>
Meeting Location:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<INPUT TYPE=TEXT NAME="location" VALUE="" SIZE=50 MAXLENGTH=50>
<BR>
</P>
<P>
Time Began:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<INPUT TYPE=TEXT NAME="began" SIZE=12 VALUE="" MAXLENGTH=12>
<EM> &nbsp; </EM></P>
<P>
Time Ended:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<INPUT TYPE=TEXT NAME="ended" SIZE=12 VALUE="" MAXLENGTH=12>
</P>
<P>
Attendance:
(enter names)<BR>
<TEXTAREA NAME="attendance" ROWS=9 COLS=109></TEXTAREA>
<BR>
</P>
<P>
# Members Attended:&nbsp;
<INPUT TYPE=TEXT NAME="members" VALUE="" SIZE=5 MAXLENGTH=5>
<BR>
</P>
<P>
# Guests:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<INPUT TYPE=TEXT NAME="guests" VALUE="" SIZE=5 MAXLENGTH=5>
<BR>
</P>
<P>
Comments / Important Points:
<BR>
<TEXTAREA NAME="comments" ROWS=5 COLS=109></TEXTAREA>
<br>
<BR>
</P>
Please select your Zone Supervisor from the dropdown list below and click Send.<br>
<SELECT Name="MailAddresses">
<option value="bob@cycominc.com">Bob
<option value="bjones@omnidevelopments.com">BJones
<option value="name3@bla.com">Lee
</SELECT>

<input type="submit" value="Send Mail" name="submit">

<p>&nbsp;</p>
</p>
<HR>
<H5>
Author: Bob Jones <br>Copyright © 2004 WCG Lexington. All rights reserved. <BR>
Revised:
<!--WEBBOT BOT=TimeStamp
    S-Type="EDITED"
    S-Format="%m/%d/%y"
--></H5>
</FORM>
</BODY>
</HTML>

####### form.php ####### (you can change this name, but note to change it in the action part of your form tag --> very N.B!)
<?php
$SendTo = "TYPE YOUR RECIPENT HERE (e.g someuser@gmail.com)";
$Subject = $_POST["subject"];
$Headers = "TYPE YOUR HEADER HERE";
$Message = "Leader Name: ".$_POST ['leader']."\n
Intern Name : ".$_POST ['intern']."\n
Meeting Date : ".$_POST ['meetingdate']."\n
Meeting Location : ".$_POST ['location']."\n
Time Began : ".$_POST ['began']."\n
Time Ended : ".$_POST ['ended']."\n
# Attendence : ".$_POST ['attendence']."\n
# Members Attended: ".$_POST ['members']."\n
#Guests: ".$_POST ['guests']."\n
Comments / Important Points: ".$_POST ['comments']."\n
Zone Supervisor: ".$_POST ['MailAddresses'];
mail($SendTo, $Subject, $Message, $Headers);
?>
<html>
<head>
      <title></title>
</head>
<body>
<center>
<p>Your details have been send,</p>
<p>Thank you!</p>
<a href="form.html" target="_self" title="Click here to go back to the main menu">Home</a>
</center>
</body>
</html>

This code is untested but if errors or question about it, please let me know...

Cheers

Sean ;-)
0
 
ellandrdCommented:
p.s change attendence to attendance, as it returns error

sean
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now