Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form-mail CGI Scripts 1

Status
Not open for further replies.

Tefal

Technical User
Jul 25, 2001
3
GB
I have a CGI script that will send form contents to an e-mail address, but can't get it to run under IIS 5

The directory is set-up correctly, but returns an error saying '%1 is not a valid Win32 application'

Please help!!
 
did you install cgi extentions on you IIS server ??
If not you have to becouse they are not istalled as default on IIS.
I hope that this helps.
;-)
 
I don't get the option to install it.

Am using IIS 5 and have looked everywhere to install but cannot find it.
 
I think all guy could tell me in detail how to configure this because i'm a newbies.

Hope your reply soon

Trong
 
What kind of CGI is it? PHP, Perl, C++ ? What ending does the file have?
 
It's a CGI script written in Perl with a .CGI extension
 
If you have formmail.cgi or something like that, the mail script is calling up sendmail which is for unix/linux. Use something like CDO for NTS and make sure you have SMTP server installed in your IIS properties.

Here's the code

&quot;<% @language=&quot;VBSCRIPT&quot; %>

<%
Set objMail = Server.CreateObject(&quot;CDONTS.Newmail&quot;)
objMail.To = request.form (&quot;recipient&quot;)
objMail.Subject = request.form (&quot;name&quot;)
objMail.From = request.form (&quot;email&quot;)
objMail.Body = request.form (&quot;message&quot;)
objMail.Send
Set objMail = Nothing


Response.Redirect &quot;
%>&quot;

This would be the processor that your form sends to. It's ASP of course, but just make this a file called process.asp and put it in the same dir as the form you want to use. For the mailer form use code that looks like this

&quot;<form action=&quot;processmail.asp&quot; method=&quot;POST&quot;>
<input type=&quot;hidden&quot; name=&quot;recipient&quot; size=&quot;25&quot; value=&quot;youremail@yourdomain.com&quot;>
<tr>
<th width=&quot;588&quot; height=&quot;453&quot;>
</center>
<p align=&quot;center&quot; style=&quot;margin-left: 50; margin-right: 50; margin-top: 5&quot;> 
<p align=&quot;center&quot; style=&quot;margin-left: 50; margin-right: 50; margin-top: 5&quot;>Send
Us A Message
<table width=478 border=0 cellpadding=0 cellspacing=0>
<tr>
<font face=&quot;Trebuchet MS, ms sans serif, Verdana,Arial&quot; size=2 color=#f0f0f0>
<td width=&quot;114&quot;>Name </td>
</font>
<font face=&quot;Trebuchet MS, ms sans serif, Verdana,Arial&quot; size=2 color=#f0f0f0>
<td width=&quot;360&quot;><input type=&quot;text&quot; name=&quot;name&quot; size=&quot;25&quot;></td>
</font>
</tr>
<tr>
<font face=&quot;Trebuchet MS, ms sans serif, Verdana,Arial&quot; size=2 color=#f0f0f0>
<td width=&quot;114&quot;>Your Email </td>
</font>
<font face=&quot;Trebuchet MS, ms sans serif, Verdana,Arial&quot; size=2 color=#f0f0f0>
<td width=&quot;360&quot;><input type=&quot;text&quot; name=&quot;email&quot; size=&quot;25&quot;></td>
</font>
</tr>
<tr>
<font face=&quot;Trebuchet MS, ms sans serif, Verdana,Arial&quot; size=2 color=#f0f0f0>
<td width=&quot;114&quot;>Message </td>
</font>
<font face=&quot;Trebuchet MS, ms sans serif, Verdana,Arial&quot; size=2 color=#f0f0f0>
<td width=&quot;360&quot;><textarea rows=&quot;7&quot; name=&quot;message&quot; cols=&quot;30&quot;></textarea></td>
</font>
</tr>
</table>
<input type=&quot;submit&quot; value=&quot;Submit&quot;> <input type=&quot;reset&quot; value=&quot;Reset&quot;>
</form>&quot;

drop that &quot;<form>&quot; into your page and it will enter the form contents into your process.asp and then mail it out with your default smtp server that comes with IIS.

Hope this helps, it works great for me and my clients.

DTodd@cnd2k.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top