From: RaghuNath L(Raghu) (lraghunath@Lucent.Com)
Date: Mon May 06 2002 - 09:01:23 EDT
Hello Managers,
This is off topic post,as most of you are in support kind of positions .
There is always's a need for web enabling the helpdesk processes.
This one which customized by me from public domain .
May help one of you in the list.
But i request if you have some perl skills ,please update this provide a
copy to me.
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Mozilla/4.76C-CCK-MCD EMS-1.5 [en]
(X11; U; SunOS 5.7 sun4u) [Netscape]">
<title>Email Form</title>
<!--Email form created by UseForeSite at http://useforesite.com please
leave this notice intact. -->
</head>
<body>
<h1>
Ins
Helpdesk <img
SRC="logo.gif" NOSAVE height=65 width=215></h1>
Please fill out the form below. Thank you.
<br><form ACTION="cgi-bin/email.cgi" METHOD="POST">
<center><table BORDER=2 WIDTH="380" HEIGHT="598" >
<tr>
<td ALIGN=RIGHT WIDTH="411" HEIGHT="35" BGCOLOR="#C0C0C0">
<center><b>Name:</b><input
NAME="01_Name" SIZE="30"></center>
</td>
</tr>
<tr ALIGN=CENTER>
<td ALIGN=RIGHT WIDTH="411" HEIGHT="35" BGCOLOR="#C0C0C0">
<center><b>Hostname:</b><input
NAME="02_Hostname" SIZE="15"></center>
</td>
</tr>
<tr ALIGN=CENTER>
<td ALIGN=RIGHT WIDTH="411" HEIGHT="35" BGCOLOR="#C0C0C0">
<center><b> PC/SUN :<select
NAME="03_Make"><option></b>PC</option><option>SUN</option></select></center>
</td>
</tr>
<tr ALIGN=CENTER>
<td ALIGN=RIGHT WIDTH="411" HEIGHT="35" BGCOLOR="#C0C0C0">
<center> <b>Extension:</b><input
NAME="04_Extension" SIZE="4"></center>
</td>
</tr>
<tr ALIGN=CENTER>
<td ALIGN=RIGHT WIDTH="411" HEIGHT="35" BGCOLOR="#C0C0C0">
<center><b>Your email:</b><input NAME="05_Email" SIZE="30"></center>
</td>
</tr>
<tr ALIGN=CENTER>
<td ALIGN=RIGHT WIDTH="411" HEIGHT="35" BGCOLOR="#C0C0C0">
<center><b>Your Cubicle:</b><input NAME="06_Cubicle" SIZE="4"></center>
</td>
</tr>
<tr ALIGN=CENTER>
<td ALIGN=RIGHT WIDTH="411" HEIGHT="70" BGCOLOR="#C0C0C0">
<center><b>Problem Description </b><textarea NAME="07_Description"
ROWS="4" COLS="25" WRAP="virtual"></textarea></center>
</td>
</tr>
<tr ALIGN=CENTER>
<td WIDTH="390" HEIGHT="48">
<center><input TYPE="submit"><input
TYPE="reset">
<br><font size=-1>Form created by System Admin Team </font></center>
</td>
</tr>
</table></center>
</form>
</body>
</html>
Here is cgi script email.cgi
#!/usr/local/bin/perl
# This first line should be addressed to your perl program usually that
# will be /usr/bin/perl or /usr/local/bin/perl to find out where perl is
# on your system, telnet to the server and type whereis perl or which perl
# in the shell window. Always leave the # and ! at the beginning of the
# first line
# This script is provided as is with no warrenty implied or stated.
# Use it at your own risk. We are NOT responsible for it's use or misuse.
# email.cgi
# configuration area: configure the six variables below on the right side
# of the = to match your specific information.
#############################################################
$formname = 'Work Order Form'; # Identify the form. Assign any name here
which
# will remind you of which form it's
refering to.
$sendmail = '/usr/lib/sendmail'; # where is sendmail? type whereis
sendmail on your
# server and enter sendmails address
here. The most
# common two options for this field are
# /usr/sbin/sendmail or /usr/lib/sendmail
$recipient = 'system-admin@yourcompany.com'; # Address this line to
yourself or wherever it's going.
$sender = 'System Admin<system-admin@yourcompany.com>'; # If "my email"
section of the form is bogus,
#$sender = # If "my email" section of the form is bogus,
# "Anonymous" will be received as
the sender
# of the form.
$site_name = 'your Development Center'; # Name of site to return
to after form submission.
$site_url = 'http://www.company.com'; # URL of site to return to after
submission.
#############################################################
# script begins here...
use CGI;
$query = new CGI;
# bundle up form submission into a mail_content format
foreach $field (sort ($query->param)) {
foreach $value ($query->param($field)) {
$mail_content .= "$field: $value\n";
}
}
# set an appropriate From: address
if (($email = $query->param('05_Email')) and
($query->param('05_Email') =~ /@/)) {
# the user supplied something that looks like
# an email address
if ($name = $query->param('01_Name')) {
# the user supplied a name
$name =~ s/"//g; # lose any double-quotes in name
$sender = "\"$name\" <$email>";
} else {
# user did not supply a name
$sender = "$email";
}
}
$mail_content = "Name: ".$name."\nHostname:
".$query->param('02_Hostname')."\nMake:
".$query->param('03_Make')."\nExtension:
".$query->param('04_Extension')."\nEmail: ".$email."\nCubicle:
".$query->param('06_Cubicle')."\nDescription:
".$query->param('07_Description')."\n";
# send the email message
open(MAIL, "|$sendmail -oi -t") or die "Can't open pipe to $sendmail: $!\n";
print MAIL "To: $recipient\n";
print MAIL "From: $sender\n";
print MAIL "CC: $sender\n";
print MAIL "Subject: New call for Helpdesk\n\n";
print MAIL "The following information was submitted via $formname.\n";
print MAIL "$mail_content";
close(MAIL) or die "Can't close pipe to $sendmail: $!\n";
# now show the thank-you screen
print "Content-type: text/html\n\n";
print <<"EOF";
<HTML>
<HEAD>
<TITLE>Thank you</TITLE>
</HEAD>
<BODY>
<H1>Thank you</H1>
<P>Thank you for your form submission. Helpdesk Team will contact you
shortly.</P>
<P>Future developments planned are as following</P>
<P>Conectivity to post db</P>
<P>Call status report</P>
<P>Faq's are availble at $site_name-->faq
-->Infrastructure -->Helpdesk</P>
<P>Return to
<A HREF="$site_url">$site_name</A>.</P>
</BODY>
</HTML>
EOF
Thakns and regards
Raghu
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:24:17 EDT