Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > using cdosys.asp for form mail

Reply
Thread Tools

using cdosys.asp for form mail

 
 
Steve
Guest
Posts: n/a
 
      04-26-2007
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,S toryTitle,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 Removed)"
oMail.From = "(E-Mail 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
%>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to retrieve form field value if form is EncType=multipart/form-dataForm? Li Zhang ASP .Net 4 02-27-2009 01:23 AM
"Failure Sending Mail" when using System.Net.Mail and ASP.Net 2.0 HoustonComputerGuy@gmail.com ASP .Net 4 09-28-2007 03:57 PM
<form>...</form> - how to supress blank space after </form> in IE? rob c Javascript 4 12-30-2005 06:10 PM
Mail insertion hack on Send Mail form nauticalmac ASP General 0 12-23-2005 12:13 PM
e-mail form to an internal e-mail server?? Tim HTML 12 07-15-2005 04:14 PM



Advertisments