JasonC
05-06-2009, 10:14 PM
Hi!
I do not know much about ASP, but I was tasked with creating a form for an HTML site, and processing said form and emailing the entered data with ASP.
I'm unable to install IIS and I'm running my ASP on our development server which is running an Apache server.
Here's my code:
<%@LANGUAGE="JAVASCRIPT"%>
<!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=utf-8" />
<title>After Action Report Results</title>
</head>
<body>
<%
dim comname, date, poc, time, loc, comments
comname=Request.Form("comname")
date=Request.Form("date")
poc=Request.Form("poc")
time=Request.Form("time")
loc=Request.Form("loc")
comments=Request.Form("comments")
%>
<%
Dim ObjSendMail
Set ObjSendMail = CreateObject("CDO.Message")
//This section provides the configuration information for the remote SMTP server.
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 //Send the message using the network (SMTP over the network).
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtpserver.mail.com"
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False //Use SSL for the connection (True or False)
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
// If your server requires outgoing authentication uncomment the lines below and use a valid email address and password.
//ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication
//ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="somemail@yourserver.com"
//ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="yourpassword"
ObjSendMail.Configuration.Fields.Update
//End remote SMTP server configuration section==
ObjSendMail.To = "soandso@email.com"
ObjSendMail.Subject = "Report"
ObjSendMail.From = "ACC"
ObjSendMail.HTMLBody = "Report<br /><br />
Community Name: <b><% Response.write(comname) %></b><br />
Date: <b><% Response.write(date) %></b><br />
Event Planner or Point of Contact: <b><% Response.write(poc) %></b><br />
<br />
Time: <b><% Response.write(time) %></b><br />
Location: <b><% Response.write(loc) %></b><br />
Additional Comments: <b><% Response.write(comments) %></b><br />"
//for text-only body
//ObjSendMail.TextBody = "this is the body"
ObjSendMail.Send
Set ObjSendMail = Nothing
%>
Thank you for submitting your Report!
<br />
<br />
Please use your browser's "back" button to return to the page.
</body>
</html>
The above is from my formProcess.asp file which I currently have set in the "action" attribute of the form tag on the report.html page (which is the page with the form on it).
Can anybody tell me what I'm doing wrong?
I do not know much about ASP, but I was tasked with creating a form for an HTML site, and processing said form and emailing the entered data with ASP.
I'm unable to install IIS and I'm running my ASP on our development server which is running an Apache server.
Here's my code:
<%@LANGUAGE="JAVASCRIPT"%>
<!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=utf-8" />
<title>After Action Report Results</title>
</head>
<body>
<%
dim comname, date, poc, time, loc, comments
comname=Request.Form("comname")
date=Request.Form("date")
poc=Request.Form("poc")
time=Request.Form("time")
loc=Request.Form("loc")
comments=Request.Form("comments")
%>
<%
Dim ObjSendMail
Set ObjSendMail = CreateObject("CDO.Message")
//This section provides the configuration information for the remote SMTP server.
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 //Send the message using the network (SMTP over the network).
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtpserver.mail.com"
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False //Use SSL for the connection (True or False)
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
// If your server requires outgoing authentication uncomment the lines below and use a valid email address and password.
//ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication
//ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="somemail@yourserver.com"
//ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="yourpassword"
ObjSendMail.Configuration.Fields.Update
//End remote SMTP server configuration section==
ObjSendMail.To = "soandso@email.com"
ObjSendMail.Subject = "Report"
ObjSendMail.From = "ACC"
ObjSendMail.HTMLBody = "Report<br /><br />
Community Name: <b><% Response.write(comname) %></b><br />
Date: <b><% Response.write(date) %></b><br />
Event Planner or Point of Contact: <b><% Response.write(poc) %></b><br />
<br />
Time: <b><% Response.write(time) %></b><br />
Location: <b><% Response.write(loc) %></b><br />
Additional Comments: <b><% Response.write(comments) %></b><br />"
//for text-only body
//ObjSendMail.TextBody = "this is the body"
ObjSendMail.Send
Set ObjSendMail = Nothing
%>
Thank you for submitting your Report!
<br />
<br />
Please use your browser's "back" button to return to the page.
</body>
</html>
The above is from my formProcess.asp file which I currently have set in the "action" attribute of the form tag on the report.html page (which is the page with the form on it).
Can anybody tell me what I'm doing wrong?