Current location: Hot Scripts Forums » Programming Languages » ASP » Problem with CDONTS


Problem with CDONTS

Reply
  #1 (permalink)  
Old 08-06-03, 10:36 AM
javadude2003 javadude2003 is offline
Newbie Coder
 
Join Date: Jul 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Problem with CDONTS

I have a small problem with this code that I am using for my web site that will send an email to me using CDONTS. It is used for someone who wishes to purchase a hosting plan with my site and sends me some basic info so i can look at it via an email.

The code is spanned over two pages so far. One page is the form that viewer fills out and the second page builds all the variables, validates the info and sends it using CDONTS. However, when I try this script I made, all it does is sit trying to load after i hit the send button. Is it a problem with my script or a problem with CDONTS itself? The code is pasted below

Page with form:
<script language="JavaScript">
<!--
function isValid(form) {
if (form.Password.value != form.Password2.value) {
alert("Passwords do not match!");
return false;
}
return true;
}
//-->
</script>


</head>

<body bgcolor="#FFFFFF" text="#000000" topmargin="0" leftmargin="0">
<table border="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber21" cellpadding="0" bgcolor="#FFFFFF">
<tr>
<td width="100%">
<img border="0" src="../../images/services/servtab_hosting.jpg"></td>
</tr>
<tr>
<td width="100%">
<form method="POST" action="services_sendform.asp" name="FrontPage_Form1">
<table border="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber22" cellpadding="0">
<tr>
<td width="65%" colspan="2"><u><b><font color="#800000">Contact Info</font></b></u></td>
</tr>
<tr>
<td width="15%"><b><font size="2">Email:</font></b></td>
<td width="50%"><input type="text" name="sender" size="30"></td>
</tr>
<tr>
<td width="15%"><font size="2"><b>Name:</b></font></td>
<td width="50%"><input type="text" name="sendername" size="25"></td>
</tr>
<tr>
<td width="15%"><b><font size="2">Phone number:</font></b></td>
<td width="50%"><b><font size="2">
<input type="text" name="phone" size="15"></font></b></td>
</tr>
<tr>
<td width="65%" colspan="2"><u><font color="#800000"><b>Plan Options</b></font></u></td>
</tr>
<tr>
<td width="15%"><b><font size="2">Domain name:</font></b></td>
<td width="50%">
<input type="text" name="domain" size="25" value="http://"></td>
</tr>
<tr>
<td width="15%"><font size="2"><b>Plan: </b></font></td>
<td width="50%"><font size="2"><b>
<select size="1" name="plan">
<option selected>Choose a plan</option>
<option>Economy Fusion Plan</option>
<option>Standard Fusion Plan</option>
<option>Professional Fusion Plan</option>
<option>Custom Fusion</option>
</select></b></font></td>
</tr>
<tr>
<td width="15%"><font size="2"><b>Administration: </b></font></td>
<td width="50%"><font size="2"><b>
<input type="radio" value="managed" name="admin"></b>Managed by web
host <input type="radio" name="admin" value="remote">Managed remotely</font></td>
</tr>
<tr>
<td width="15%"><font size="2"><b>Options: </b></font></td>
<td width="50%"><font size="2"><b>
<input type="checkbox" name="options" value="FTP_access"></b>FTP
access<br>
<input type="checkbox" name="options" value="add_storage">Additional
storage<br>
<input type="checkbox" name="options" value="add_mailboxes">Extra
mailboxes<br>
<input type="checkbox" name="options" value="webstats">Web statistics<br>
<input type="checkbox" name="options" value="backups">Special backups</font></td>
</tr>
<tr>
<td width="65%" colspan="2"><u><font color="#800000"><b>Account Info</b></font></u></td>
</tr>
<tr>
<td width="15%"><b><font size="2">Title of website:</font></b></td>
<td width="50%">
<input type="text" name="webname" size="20"></td>
</tr>
<tr>
<td width="15%"><b><font size="2">Password:</font></b></td>
<td width="50%">
<input type="password" name="password" size="20"></td>
</tr>
<tr>
<td width="15%"><b><font size="2">Verify password:</font></b></td>
<td width="50%">
<input type="password" name="password2" size="20"></td>
</tr>
<tr>
<td width="65%" colspan="2"><b><font size="2">Additional comments or
requests below:</font></b><br>
<textarea rows="10" name="comments" cols="50"></textarea></td>
</tr>
<tr>
<td width="65%" colspan="2">
<p align="center"><input type="submit" value="Submit" name="B1">
<input type="reset" value="Reset" name="B2"></td>
</tr>
</table>

<input type="hidden" name="failure" value="">

</form>
</td>
</tr>
<tr>
<td width="100%">&nbsp;</td>
</tr>
</table>

Here's the page that sends the e-mail
<%
' ## FORM VALUES ##
' sendername From (Name) (If omitted shows: sender address)
' sender From (required)
' recipient To (required)
' subject Email Subject (If omitted shows: No subject)
' comment User definded body text (If omitted shows: No message)
' failure Page to show if there is a problem. Default is this script (see bottom). Must be web location of file to show

'
' First prevent this file being displayed without submitting data
' Delete this to remove post protection
If LCase(Request.ServerVariables("REQUEST_METHOD")) <> "post" Then
Response.Redirect(Request.ServerVariables("URL") & "?prob=post")
End If



' ## VALUES ##
' Form values
sender = Trim(request("sender")) 'From
sendername = request("sendername") 'From (Name)
recipient = "webfusionnet@comcast.net" 'To
subject = "Hosting for: " & request("webname") 'Email Subject
phone = request("phone")
domain = request("domain")
plan = request("plan")
admin = request("admin")
options = request("options")
webname = request("webname")
password = request("password")
password2 = request("password2")
comment = request("comment") 'User definded body text
failure = request("failure") 'Page to show if there is a problem. Default is the referring page.

' ## ADDRESS CHECK ##
' Check that there is a valid email address for the "sender" fields
If Len(sender) = 0 Or Instr(sender, "@") = 0 Or Instr(str_sender, ".") = 0 Then
Response.Redirect(failure & "?prob=sender")
End If

message = "HOSTING PLAN FROM WEB FUSION NETWORKS" & vbcrlf & vbcrlf & "Name: " & sendername & vbcrlf & "E-mail: " & sender & vbcrlf & "Phone: " & phone & vbcrlf & vbcrlf & "Domain: " & domain & vbcrlf & "Hosting Plan: " & plan & vbcrlf & "Administration: " & admin & vbcrlf & "Options: " & options & vbcrlf & vbcrlf & "Website Title: " & webname & vbcrlf & "Password: " & password

details = "Host: " & request.ServerVariables("REMOTE_ADDR") & vbcrlf & "Referer: " & request.ServerVariables("HTTP_REFERER") & vbcrlf & "Time/Date: " & Now


' ## SENDING EMAIL ##
' Setup CDONTS Email to be sent
Set objNewMail = Server.CreateObject("CDONTS.NewMail")
objNewMail.From = sendername & "<" & sender & ">"
objNewMail.Subject = subject
objNewMail.To = recipient
objNewMail.Body = message & vbcrlf & vbcrlf & comment & vbcrlf & vbcrlf & details
objNewMail.Send ' Send it
Set objNewMail = Nothing ' Destroy the sent email %>

<html>
<head>
<title>Email sending details</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../../Style/styles.css">

<meta name="Microsoft Border" content="tlrb">
</head>

<body bgcolor="#FFFFFF" text="#000000" topmargin="0" leftmargin="0">

<% If Request.QueryString("prob") = "" Or Len(Request.QueryString("prob")) < 1 Then %>

<table border="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" cellpadding="0" bgcolor="#FFFFFF">
<tr>
<td width="100%">
<img border="0" src="../../images/services/servtab_hosting.jpg"></td>
</tr>
<tr>
<td width="100%"><u><b>
<font face="Arial, Helvetica, sans-serif" color="#800000">Email sent successfully!</font></b></u></td>
</tr>
<tr>
<td width="100%">Name: <b><%= sendername %></b><br>
E-mail: <b><%= sender %></b><br>
Phone: <b><%= phone %></b>
<p>Domain: <b><%= domain %></b><br>
Hosting plan: <b><%= plan %></b><br>
Administration: <b><%= admin %></b><br>
Options: <b><%= options %></b></p>
<p>Website title: <b><%= webaname %></b><br>
Password: <b><%= password %></b></p>
<p>Comments: <b><%= Replace(Server.HTMLEncode(comment),Chr(13),"<br>") %></b></td>
</tr>
<tr>
<td width="100%">

<% ElseIf Request.QueryString("prob") = "Sender" Then %>
<font face="Arial, Helvetica, sans-serif" size="2" color="red"><b>There was a problem with the senders address, please go back and try again.</b></font>
<% ElseIf Request.QueryString("prob") = "post" Then %>
<font face="Arial, Helvetica, sans-serif" size="2" color="red"><b>You must post data to this script in order for anything to be mailed to the appropriate recipient.</b></font>
</td>
</tr>
<tr>
<td width="100%"><a href="../../services.htm">
<img border="0" src="../../images/backtopage.jpg">Back to the hosting plans</a></td>
</tr>
</table>

<% End If %>

**Note some of the code is cut off because it was not necessary to paste here

Thanks for the help if anyone knows anything about this.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 08-06-03, 11:59 AM
BuildHome BuildHome is offline
Newbie Coder
 
Join Date: Aug 2003
Location: Israel
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
But what the error that you get ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 08-06-03, 12:49 PM
MadDog MadDog is offline
Code Master
 
Join Date: Aug 2003
Posts: 935
Thanks: 0
Thanked 0 Times in 0 Posts
have you tryed to use CDOSYS? Its like CDONTS, but better....
__________________
Drew Gauderman
ASP - MSSQL Coder / Buisness Owner / Coder for Hire!
MSN-ICQ-AIM-YIM in Profile

http://www.iportalx.net an easy ASP portal system.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 08-06-03, 12:57 PM
MadDog MadDog is offline
Code Master
 
Join Date: Aug 2003
Posts: 935
Thanks: 0
Thanked 0 Times in 0 Posts
O ya, incase you dont know what CDOSYS is or how to code it, check out my CDOSYS tutorial, http://www.invisionportal.com/show_t...TutorialID=160
__________________
Drew Gauderman
ASP - MSSQL Coder / Buisness Owner / Coder for Hire!
MSN-ICQ-AIM-YIM in Profile

http://www.iportalx.net an easy ASP portal system.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 08-06-03, 01:58 PM
javadude2003 javadude2003 is offline
Newbie Coder
 
Join Date: Jul 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Hey maddog, what's the purpose of the schema.microsoft.com stuff in your tutorial?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 08-06-03, 02:17 PM
MadDog MadDog is offline
Code Master
 
Join Date: Aug 2003
Posts: 935
Thanks: 0
Thanked 0 Times in 0 Posts
Its just part of CDOSYS, its like the settings for CDOSYS.
__________________
Drew Gauderman
ASP - MSSQL Coder / Buisness Owner / Coder for Hire!
MSN-ICQ-AIM-YIM in Profile

http://www.iportalx.net an easy ASP portal system.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #7 (permalink)  
Old 08-06-03, 02:54 PM
javadude2003 javadude2003 is offline
Newbie Coder
 
Join Date: Jul 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
OK, the script for CDOSYS did not work at all. I originally tried to use my script using CDONTS from my SMTP server. I may not have the configured properly though. The purpose is to have some fill out this form on my website and it sends me the emails to my account at comcast.com. I tried to set that up through the SMTP server in IIS, but it does not seem to be working. All the attempts I have done is ending up in the badmail directory. When I used both my script and yours all it did was load constantly. After I clicked the send button, it just loaded, then loaded again and again. It never went to the confirmation page that actually sends the email. So if I am doing something wrong or if you have any input, it would be a reat deal of help right now. If you need the lin kto check out what i am talking about it is here: http://www.webfusionnet.com/NAV/Serv...vices_form.asp

Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #8 (permalink)  
Old 08-06-03, 03:17 PM
MadDog MadDog is offline
Code Master
 
Join Date: Aug 2003
Posts: 935
Thanks: 0
Thanked 0 Times in 0 Posts
Whats the OS of the server your trying to run it on?
__________________
Drew Gauderman
ASP - MSSQL Coder / Buisness Owner / Coder for Hire!
MSN-ICQ-AIM-YIM in Profile

http://www.iportalx.net an easy ASP portal system.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #9 (permalink)  
Old 08-06-03, 03:38 PM
javadude2003 javadude2003 is offline
Newbie Coder
 
Join Date: Jul 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
The OS of the server is windows 2000 advanced server
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #10 (permalink)  
Old 08-06-03, 04:07 PM
MadDog MadDog is offline
Code Master
 
Join Date: Aug 2003
Posts: 935
Thanks: 0
Thanked 0 Times in 0 Posts
Did you edit all the information you had to? (like email to send it to, smtp server, etc, etc)
__________________
Drew Gauderman
ASP - MSSQL Coder / Buisness Owner / Coder for Hire!
MSN-ICQ-AIM-YIM in Profile

http://www.iportalx.net an easy ASP portal system.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
file download problem ukyankee Perl 6 10-04-03 11:39 PM
MIME problem beshoo PHP 1 08-28-03 07:19 PM
Include problem lapo4ka18 PHP 3 08-23-03 09:03 PM
jpGraph axis labeling problem Squeezer PHP 2 08-20-03 08:53 AM
Another CDONTS Step ASP 7 08-13-03 05:20 PM


All times are GMT -5. The time now is 11:40 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.