using cdosys.asp for form mail

S

Steve

Hi

I'm using a web form to enable people to submit stories to my website, but
there appears to be issue with longer texts. When the content of the 'Story
Text' box exceeds a certain length the form doesn't submit and an error page
appears.

I've pasted the relevant code here. Can any one suggest what is wrong and
what can be done to fix.

TIA

Steve

#####################################

form page html

<form action="cdosyssub.asp" onSubmit="" name="Story Submission">
<font color="#FFFFFF"> <font size="3" face="Arial, Helvetica,
sans-serif">
Full Name</font><br>
<input type="text" size="35" maxlength="30" name="RealName"
value="">
<br>
Pen name</font><br>
<font size="1" face="Arial, Helvetica, sans-serif"
color="#FFFFFF">(name
you want story published under)</font><font size="3"
face="Arial, Helvetica, sans-serif" color="#FFFFFF"><br>
<input type="text" size="35" maxlength="30" name="PenName"
value="">
<br>
<font size="3" face="Arial, Helvetica, sans-serif">Your E-mail
address<br>
<font size="1">(this must be completed in case of queries)<br>
<input type="text" size="35" name="Email" value="">
</font><br>
<br>
<input type="hidden" size="35" maxlength="30" name="Subject"
value="Story Submission">
<br>
I confirm that the story below is either my own work, or it is
submitted
with the approval of the author and that all copyright is
correctly
attributed. I understand that by submitting this form I am
consenting
to its inclusion on www.mydomain.co.uk.</font>
<p> <font size="3" face="Arial, Helvetica, sans-serif"
color="#FFFFFF">
<input type="checkbox" name="Confirmation" value="Yes, I
agree to publication">
<font size="2">(Click to agree)</font></font>
<p><font size="3" face="Arial, Helvetica, sans-serif"
color="#FFFFFF">Story
Title </font><font color="#FFFFFF"><br>
</font><font size="3" face="Arial, Helvetica, sans-serif"
color="#FFFFFF">
<input type="text" size="35" maxlength="30"
name="StoryTitle" value="">
</font><font color="#FFFFFF"> <br>
<textarea name="StoryText" rows="10" cols="75">Please paste
a plain text version of your story here</textarea>
<br>
<input type="submit" name ="SUBMIT" value="SUBMIT" >
</font>
</font>
</form>

################################################
cdosys.asp

{the following sits in front of the html tags for that file}

<%
dim HTML,RealName,PenName,Email,Subject,Confirmation,StoryTitle,StoryText
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>Your 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("RealName") & "</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>Pen 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("PenName") & "</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>Your Email Address: </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("Email") & "</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>Subject: </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("Subject") & "</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>Agreement to Publication: </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("Confirmation") & "</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>Story Title: </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("StoryTitle") & "</p>"
HTML = HTML & " </td>"
HTML = HTML & " </tr>"
HTML = HTML & " <tr>"
HTML = HTML & " <th colspan=""2"" bgcolor=""#B0CDDD"">"
HTML = HTML & " <p style=""margin-top:1;margin-bottom:1"" align=""left"">
<font face=""arial"" size=""2""> <b>Story Text: </b> </font> </p>"
HTML = HTML & " </th>"
HTML = HTML & " </tr>"
HTML = HTML & " <tr>"
HTML = HTML & " <td colspan=""2"" bgcolor=""#B0CDDD"">"
HTML = HTML & " <p style=""margin-top:1;margin-bottom:1"" align=""left"">
<font face=""arial"" size=""2"">" & Request("StoryText") & "</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 = "(e-mail address removed)"
oMail.From = "(e-mail address removed)"
oMail.Subject = "Story Submission"

'If message body is in HTML FORMAT
oMail.BodyPart.ContentTransferEncoding = "quoted-printable"
oMail.HTMLBody = HTML
oMail.Send
Set iConf = Nothing
Set Flds = Nothing
%>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top