I've been given some cdosys script by my site's hosts (because my contact form suddenly started generating a 500 Internal Server Error message). They told me that I need to edit the file (cdosyseg.asp), add my form's fields and then redirect my form to this script to process mails. As I know NOTHING about asp, cdosys, etc, I have no idea what to do! If I paste the scripts for the cdosys file and my contact form below, is there anyone who could put them together for me? The one thing I do know is that the TO in the oMail.To bit of their cdosys script should be "info@theeditplace.com". But that's about it!
Here's the cdosys script:
CODE
<% dim HTML,AdvisorFirstName,AdvisorLastName HTML = HTML & " <html><body>" HTML = HTML & " <table border=""0"">" HTML = HTML & " <tr>" HTML = HTML & " <th bgcolor=""#B0CDDD"">" HTML = HTML & " <p style=""margin-top:1;margin-bottom:1"" align=""left""> <font face=""arial"" size=""2""> <b> Advisor First Name: </b> </font> </p>" HTML = HTML & " </th>" HTML = HTML & " <td bgcolor=""#B0CDDD"">" HTML = HTML & " <p style=""margin-top:1;margin-bottom:1"" align=""left""> <font face=""arial"" size=""2"">" & Request("AdvisorFirstName") & "</p>" HTML = HTML & " </td>" HTML = HTML & " </tr>" HTML = HTML & " <tr>" HTML = HTML & " <th bgcolor=""#B0CDDD"">" HTML = HTML & " <p style=""margin-top:1;margin-bottom:1"" align=""left""> <font face=""arial"" size=""2""> <b> Advisor Last Name: </b> </font> </p>" HTML = HTML & " </th>" HTML = HTML & " <td bgcolor=""#B0CDDD"">" HTML = HTML & " <p style=""margin-top:1;margin-bottom:1"" align=""left""> <font face=""arial"" size=""2"">" & Request("AdvisorLastName") & "</p>" HTML = HTML & " </td>" HTML = HTML & " </tr>" HTML = HTML & " </table>" HTML = HTML & "<br>" HTML = HTML & " </body></html>"
'CDOSYS Configuration Set oMail = Server.CreateObject("CDO.Message") Set iConf = Server.CreateObject("CDO.Configuration") Set Flds = iConf.Fields
'Default parameters for Dataflame (dont change) iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost" 'Note 'Use "localhost" If mail is routed from same server. 'Use Server IP like "203.90.78.221" if Domain has MX record having IP "203.90.78.221" OR Mails are routed from that IP
'If message body is in HTML FORMAT oMail.BodyPart.ContentTransferEncoding = "quoted-printable" oMail.HTMLBody = HTML oMail.Send Set iConf = Nothing Set Flds = Nothing %> <html> Message Sent </html>
Here's my contact form:
<%@ Language=VBScript%> <% Dim action action = Request.Form("action") If action = "" Then action = Request.Querystring("action") End If
If action = "submitContactForm" Then submitContactForm() End If
Function submitContactForm() Dim Name, Surname, Email, Document_Title, Other Dim Message
'Collect the information from the submitted contact form Name = Request.Form("name") Surname = Request.Form("surname") Email = Request.Form("email") Document_Title = Request.Form ("title") Other = Request.Form("other")
'Strip single quotes out of the contact form Other = Replace(Other, "'", "''")
'Set up the mail message Message = "<table>" Message = Message & "<tr><td colspan='2' style='font-weight:bold;'>The following information has been submitted via the contact form:</td></tr>" Message = Message & "<tr><td>Name:</td><td>" & Name & "</td></tr>" Message = Message & "<tr><td>Surname:</td><td>" & Surname & "</td></tr>" Message = Message & "<tr><td>Email:</td><td>" & Email & "</td></tr>" Message = Message & "<tr><td>Document Title:</td><td>" & Document_Title & "</td></tr>" Message = Message & "<tr><td>Other:</td><td>" & Other & "</td></tr>" Message = Message & "</table>"
SendEmail(Message)
End Function
Function SendEmail(Message)
'// Set up the CDO Mail Object Set oMail = Server.CreateObject("CDO.Message")
'// Configure the Mail Server Set oMailConfig = Server.CreateObject("CDO.Configuration")
'// Set the mail config. fields. oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost" oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 oMailConfig.Fields.Update
Set oMail.Configuration = oMailConfig
'// Set the mail headers oMail.From = "contact@theeditplace.com" oMail.To = "info@theeditplace.com" '// oMail.Subject = "A form submission from theeditplace.com" '//
'// Set the email body oMail.HTMLBody = Message
'// Send the email oMail.Send
'//Clear the mail object and configuration fields Set oMail = Nothing Set oMailConfig = Nothing
End Function
%> <!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> <title>Contact theeditplace.com</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
var now = new Date(); var days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'); var months = new Array('January','February','March','April','May','June','July','August','September','October','November','December'); var date = ((now.getDate()<10) ? "0" : "")+ now.getDate(); function fourdigits(number) { return (number < 1000) ? number + 1900 : number; } today = days[now.getDay()] + ", " + months[now.getMonth()] + " " + date + ", " + (fourdigits(now.getYear())) ;
document.write("" +today+ "");
//--></SCRIPT> </td> </tr>
<tr> <td height="473" colspan="2"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="30%" height="215"><img src="logo%20copy.jpg" width="214" height="72" /></td> <td width="70%" height="400" align="center" valign="middle" background="images/pen.jpg"> <table width="415" height="282" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="415" height="282"><p align="left" class="bodytext"><strong>Contact Us</strong></p> <p align="center" class="bodytext"><strong>Email</strong><br /> info@theeditplace.com</p> <p align="center" class="bodytext"><strong>Phone</strong><br /> 0871 218 0396 (within the UK)<br /> + 44 871 218 0396 (outside the UK)</p> <p align="center" class="bodytext"><strong>Fax</strong><br /> 0871 218 0397 (within the UK)<br /> + 44 871 218 0397 (outside the UK)</p> <p align="center" class="bodytext"><strong>Post</strong><br /> 16 Mount Batten, London N6 4HJ, England</p> <p align="left" class="bodytext"><strong>Request Information</strong></p> <form id="contact_form" method="post" action="contact.asp"> <% If action <> "" Then 'You can change this message to say whatever you want to say. Response.Write("<p style='color:#42487c; text-align:center;'>Thank you for your interest! Somebody will be in touch with you shortly.</p>") End If
Hi,
I've been given some cdosys script by my site's hosts (because my contact form suddenly started generating a 500 Internal Server Error message). They told me that I need to edit the file (cdosyseg.asp), add my form's fields and then redirect my form to this script to process mails. As I know NOTHING about asp, cdosys, etc, I have no idea what to do! If I paste the scripts for the cdosys file and my contact form below, is there anyone who could put them together for me? The one thing I do know is that the TO in the oMail.To bit of their cdosys script should be "info@theeditplace.com". But that's about it!
Here's the cdosys script:
dim HTML,AdvisorFirstName,AdvisorLastName
HTML = HTML & " <html><body>"
HTML = HTML & " <table border=""0"">"
HTML = HTML & " <tr>"
HTML = HTML & " <th bgcolor=""#B0CDDD"">"
HTML = HTML & " <p style=""margin-top:1;margin-bottom:1"" align=""left""> <font face=""arial"" size=""2""> <b> Advisor First Name: </b> </font> </p>"
HTML = HTML & " </th>"
HTML = HTML & " <td bgcolor=""#B0CDDD"">"
HTML = HTML & " <p style=""margin-top:1;margin-bottom:1"" align=""left""> <font face=""arial"" size=""2"">" & Request("AdvisorFirstName") & "</p>"
HTML = HTML & " </td>"
HTML = HTML & " </tr>"
HTML = HTML & " <tr>"
HTML = HTML & " <th bgcolor=""#B0CDDD"">"
HTML = HTML & " <p style=""margin-top:1;margin-bottom:1"" align=""left""> <font face=""arial"" size=""2""> <b> Advisor Last Name: </b> </font> </p>"
HTML = HTML & " </th>"
HTML = HTML & " <td bgcolor=""#B0CDDD"">"
HTML = HTML & " <p style=""margin-top:1;margin-bottom:1"" align=""left""> <font face=""arial"" size=""2"">" & Request("AdvisorLastName") & "</p>"
HTML = HTML & " </td>"
HTML = HTML & " </tr>"
HTML = HTML & " </table>"
HTML = HTML & "<br>"
HTML = HTML & " </body></html>"
'CDOSYS Configuration
Set oMail = Server.CreateObject("CDO.Message")
Set iConf = Server.CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
'Default parameters for Dataflame (dont change)
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
'Note
'Use "localhost" If mail is routed from same server.
'Use Server IP like "203.90.78.221" if Domain has MX record having IP "203.90.78.221" OR Mails are routed from that IP
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
iConf.Fields.Update
Set oMail.Configuration = iConf
oMail.To = "test@netpivotal.com"
oMail.From = "contact@theeditplace.com"
oMail.Subject = "New Email!"
'If message body is in HTML FORMAT
oMail.BodyPart.ContentTransferEncoding = "quoted-printable"
oMail.HTMLBody = HTML
oMail.Send
Set iConf = Nothing
Set Flds = Nothing
%>
<html>
Message Sent
</html>
Here's my contact form:
<%@ Language=VBScript%>
<%
Dim action
action = Request.Form("action")
If action = "" Then
action = Request.Querystring("action")
End If
If action = "submitContactForm" Then submitContactForm() End If
Function submitContactForm()
Dim Name, Surname, Email, Document_Title, Other
Dim Message
'Collect the information from the submitted contact form
Name = Request.Form("name")
Surname = Request.Form("surname")
Email = Request.Form("email")
Document_Title = Request.Form ("title")
Other = Request.Form("other")
'Strip single quotes out of the contact form
Other = Replace(Other, "'", "''")
'Set up the mail message
Message = "<table>"
Message = Message & "<tr><td colspan='2' style='font-weight:bold;'>The following information has been submitted via the contact form:</td></tr>"
Message = Message & "<tr><td>Name:</td><td>" & Name & "</td></tr>"
Message = Message & "<tr><td>Surname:</td><td>" & Surname & "</td></tr>"
Message = Message & "<tr><td>Email:</td><td>" & Email & "</td></tr>"
Message = Message & "<tr><td>Document Title:</td><td>" & Document_Title & "</td></tr>"
Message = Message & "<tr><td>Other:</td><td>" & Other & "</td></tr>"
Message = Message & "</table>"
SendEmail(Message)
End Function
Function SendEmail(Message)
'// Set up the CDO Mail Object
Set oMail = Server.CreateObject("CDO.Message")
'// Configure the Mail Server
Set oMailConfig = Server.CreateObject("CDO.Configuration")
'// Set the mail config. fields.
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
oMailConfig.Fields.Update
Set oMail.Configuration = oMailConfig
'// Set the mail headers
oMail.From = "contact@theeditplace.com"
oMail.To = "info@theeditplace.com" '//
oMail.Subject = "A form submission from theeditplace.com" '//
'// Set the email body
oMail.HTMLBody = Message
'// Send the email
oMail.Send
'//Clear the mail object and configuration fields
Set oMail = Nothing
Set oMailConfig = Nothing
End Function
%>
<!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>
<title>Contact theeditplace.com</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
background: url('/images/stripes4.jpg') repeat-y;
}
.style2 {font-family: Arial, sans-serif}
.style3 {color: #42487C}
-->
</style></head>
<body>
<table width="780" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="60" rowspan="4" valign="top"> </td>
<td height="33" colspan="2" valign="top"> </td>
</tr>
<tr>
<td width="216" height="32"> </td>
<td width="504"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20%" height="25" align="center" class="nav"><a href="index.html">Home</a></td>
<td width="20%" align="center" class="nav"><a href="About theeditplace.html">About us </a></td>
<td width="20%" align="center" class="nav"><a href="Submitting work for English editing.html">Submit work </a></td>
<td width="20%" align="center" class="nav"><a href="Pricing and payment.html">Pricing</a></td>
<td width="20%" align="center" class="nav"><a href="contact.asp">Contact</a></td>
</tr>
</table></td>
</tr>
<tr>
<td height="19"> </td>
<td align="right" class="date">
<script LANGUAGE="Javascript"><!--
var now = new Date();
var days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
var months = new Array('January','February','March','April','May','June','July','August','September','October','November','December');
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();
function fourdigits(number) {
return (number < 1000) ? number + 1900 : number;
}
today = days[now.getDay()] + ", " +
months[now.getMonth()] + " " +
date + ", " +
(fourdigits(now.getYear())) ;
document.write("" +today+ "");
//--></SCRIPT>
</td>
</tr>
<tr>
<td height="473" colspan="2">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="30%" height="215"><img src="logo%20copy.jpg" width="214" height="72" /></td>
<td width="70%" height="400" align="center" valign="middle" background="images/pen.jpg">
<table width="415" height="282" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="415" height="282"><p align="left" class="bodytext"><strong>Contact Us</strong></p>
<p align="center" class="bodytext"><strong>Email</strong><br />
info@theeditplace.com</p>
<p align="center" class="bodytext"><strong>Phone</strong><br />
0871 218 0396 (within the UK)<br />
+ 44 871 218 0396 (outside the UK)</p>
<p align="center" class="bodytext"><strong>Fax</strong><br />
0871 218 0397 (within the UK)<br />
+ 44 871 218 0397 (outside the UK)</p>
<p align="center" class="bodytext"><strong>Post</strong><br />
16 Mount Batten, London N6 4HJ, England</p>
<p align="left" class="bodytext"><strong>Request Information</strong></p>
<form id="contact_form" method="post" action="contact.asp">
<%
If action <> "" Then
'You can change this message to say whatever you want to say.
Response.Write("<p style='color:#42487c; text-align:center;'>Thank you for your interest! Somebody will be in touch with you shortly.</p>")
End If
%>
<table align="center">
<tr>
<td width="98" class="bodytext">Name:</td>
<td width="161"><input type="text" name="name" /></td>
</tr>
<tr>
<td class="bodytext">Surname:</td>
<td><input type="text" name="surname" /></td>
</tr>
<tr>
<td class="bodytext">Email Address:</td>
<td><input type="text" name="email" /></td>
</tr>
<tr>
<td valign="top"><span class="bodytext">Document Title</span>:</td
><td><input type="text" name="title" /></td>
</tr>
<tr>
<td valign="top" class="bodytext">Request:</td>
<td><textarea name="other" cols="15" rows="4"></textarea></td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="hidden" name="action" value="submitContactForm" />
<input type="submit" name="submit" value="Submit" /> </td>
</tr>
<!-- I am going to comment the document title out for right now, as we'll deal with file handling later. -->
<!--
<tr>
<td>Document Title:</td>
<td><input type="text" name="" /></td>
</tr>
-->
</table>
</form>
<p align="left" class="bodytext"> </p> </td>
</tr>
</table> </td>
</tr>
<tr>
<td height="19"> </td>
<td height="19"> </td>
</tr>
<tr>
<td height="35"> </td>
<td height="35"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><a href="Terms and Conditions of Service.doc" target="_blank" class="bodytext">Terms and Conditions </a><span class="style3"> <font face="Helvetica, Arial, sans-serif">|</font> </span><a href="Privacy Policy.doc" target="_blank" class="bodytext"> Privacy</a><span class="style3"> <font face="Helvetica, Arial, sans-serif">|</font> </span><a href="Accessibility.html" class="bodytext">Accessibility</a><span class="style3"> <font face="Helvetica, Arial, sans-serif">|</font> </span><a href="Site map for help navigating through this site.html" class="bodytext">Site Map</a></td>
</tr>
</table></td>
</tr>
<tr>
<td height="19"> </td>
<td height="19" align="center" valign="middle" class="bodytext">© theeditplace.com 2006</td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
God BLESS you!
/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
Sarah