If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > CDONTS not working - Please help

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-09-04, 09:25
Maximus2004 Maximus2004 is offline
Registered User
 
Join Date: Jun 2004
Posts: 8
Question CDONTS not working - Please help

I am not getting any errors at all, just not receiving the EMAIL.

SEE below
Emailform.asp
Scripts.asp
Submitform.asp
Submitdone.htm
*************************
<%@ Language=VBScript %>

<HTML>
<HEAD>
<TITLE></TITLE>
<!--#include file="scripts.asp"-->

</HEAD>
<BODY>
<H2><FONT COLOR="#336699">Email Form</FONT></H2> <FORM ACTION="submitform.asp" Method="Post" >
<INPUT TYPE="hidden" NAME="FormName" VALUE="emailform.asp">
<INPUT TYPE="hidden" NAME="subject" VALUE="Email Form Sample">
<INPUT TYPE="hidden" NAME="SendTo" VALUE="kklimarchuk@supremecouncil.org">
<TABLE WIDTH="274" CELLPADDING="0" CELLSPACING="0">
<TR>
<TD COLSPAN="2" ALIGN="CENTER" WIDTH="274"></TD>
</TR>
<TR>
<TD WIDTH="88">Name:</TD>
<TD WIDTH="186"><INPUT TYPE="TEXT" NAME="txtName" <%Call RequestInfo("txtName", "")%>></TD>
</TR>
<TR>
<TD WIDTH="88">Address:</TD>
<TD WIDTH="186"><INPUT TYPE="TEXT" NAME="txtAddress" <%Call RequestInfo("txtAddress", "")%>></TD>
</TR>
<TR>
<TD WIDTH="88">Phone:</TD>
<TD WIDTH="186"><INPUT TYPE="TEXT" NAME="txtPhone" <%Call RequestInfo("txtPhone", "")%>></TD>
</TR>
<TR>
<TD WIDTH="88">Email:</TD>
<TD WIDTH="186"><INPUT TYPE="TEXT" NAME="txtEmail" <%Call RequestInfo("txtEmail", "")%>></TD>
</TR>
<TR>
<TD WIDTH="88">Gender:</TD>
<TD WIDTH="186"><INPUT TYPE="RADIO" NAME="radGender" VALUE="m"
<%Call RequestInfo("radGender", "m")%>>Male&nbsp;<INPUT TYPE="RADIO" NAME="radGender"
VALUE="f" <%Call RequestInfo("radGender", "f")%>>Female</TD>
</TR>
<TR>
</TR>
<TR>
<TD COLSPAN="2" WIDTH="274"><BR><B>Check all that apply:</B></TD>
</TR>
<TR>
<TD COLSPAN="2">&nbsp;&nbsp;<INPUT TYPE="CHECKBOX" NAME="chkVB" <%Call RequestInfo("chkVB", "on")%>>
Visual Basic<BR>&nbsp;&nbsp;<INPUT TYPE="CHECKBOX" NAME="chkASP" <%Call RequestInfo("chkASP", "on")%>> ASP<BR>
&nbsp;&nbsp;<INPUT TYPE="CHECKBOX" NAME="chkJava" <%Call RequestInfo("chkJava", "on")%>> Java<BR>&nbsp;&nbsp;<INPUT
TYPE="CHECKBOX" NAME="chkOther" <%Call RequestInfo("chkOther", "on")%>> Other&nbsp;<INPUT TYPE="TEXT"
NAME="txtOther" <%Call RequestInfo("txtOther", "")%>><BR><BR></TD>
</TR>
<TR>
<TD COLSPAN="2" WIDTH="274" ALIGN="RIGHT"><INPUT TYPE="SUBMIT"
NAME="Submit" VALUE="Send Now!"></TD>
</TR>
</TABLE></FORM> </BODY>
</HTML>
*
<%
sub RequestInfo(objName, btnVal)
Select Case left(objName,3)
Case "rad", "chk"
if Request(objName)=btnVal then
Response.Write("checked")
end if
Case "sel"
if Request(objName)=btnVal then
Response.Write("selected")
end if
Case "txt"
Response.Write "Value='" & Request(objName) & "'"
End Select
end sub
%>
************************************************** ***
<%


'change this to the appropriate http
Const strHTTP = "http://test3/valleyforms/"

'get current date
strDate = Date()

'get form information
strFormName = Request("FormName")
strSubject = Request("subject")
strSendTo = Request("SendTo")

strName = Request("txtName")
strPhone = Request("txtPhone")

'if no information entered for email use your own
if instr(Request("txtEmail"), "@") <> 0 then
strFrom = Request("txtEmail")
else
strFrom = strSendTo
end if

'concat URL information
strURLInfo = strHTTP & strFormName & "?" & Request.Form()

'create the HTML for email
strHTML = "<HTML> <HEAD> <TITLE></TITLE> </HEAD>"
strHTML = strHTML & "<BODY>"
strHTML = strHTML & "<TABLE WIDTH=500 CELLPADDING=0 CELLSPACING=0>"
strHTML = strHTML & "<TR>"

'use some graphics for email
strHTML = strHTML & "<TD><IMG SRC=" & strHTTP & "emailbanner.JPG BORDER=0></TD>"
strHTML = strHTML & "</TR>"

'include basic info in email
strHTML = strHTML & "<TR>"
strHTML = strHTML & "<TD>"
strHTML = strHTML & "<BR>Date: " & strDate
strHTML = strHTML & "<BR>Subject: " & strSubject
strHTML = strHTML & "<BR>Requested by: " & strName
strHTML = strHTML & "<BR>Phone: " & strPhone

if strFrom <> strSendTo then
strHTML = strHTML & "<BR>Email: <a href=mailto:" & strFrom & ">" & strFrom & "</a>"
else
strHTML = strHTML & "<BR>Email: UNKNOWN"
end if

'add hyperlink to form in email
strHTML = strHTML & "<BR><BR>"
strHTML = strHTML & "<A HREF=" & strURLInfo & "><IMG SRC=" & strHTTP & "form.gif WIDTH=16 HEIGHT=16 BORDER=0>Click here</A>"
strHTML = strHTML & " to view completed form."
strHTML = strHTML & "</TD>"
strHTML = strHTML & "</TR>"
strHTML = strHTML & "<TR>"
strHTML = strHTML & "<TD></TD>"
strHTML = strHTML & "</TR>"
strHTML = strHTML & "</TABLE>"
strHTML = strHTML & "</BODY>"
strHTML = strHTML & "</HTML>"


'time to send the email
Dim objCDO
Set objCDO = Server.CreateObject("CDONTS.NewMail")

objCDO.To = strSendTo
objCDO.From = strFrom
objCDO.Subject = strName & " - " & strSubject
objCDO.BodyFormat = 0
objCDO.MailFormat = 0
objCDO.Body = strHTML
objCDO.Send

set objCDO = nothing

'redirect to the "Thanks" page
Response.Redirect strHTTP & "submitdone.htm"
%>
*************HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY>
<TABLE WIDTH="509" CELLPADDING="0" CELLSPACING="0">
<TR>
<TD WIDTH="509" HEIGHT="91" ALIGN="CENTER">
<H2><FONT COLOR="#336699">Transmission Successful</FONT></H2>
<P><FONT COLOR="#6600FF">We will review the information you provided
and will get back to you to complete the process.</FONT></P></TD>
</TR>
<TR>
<TD WIDTH="509" ALIGN="CENTER"><BR><B>Me<BR>1600 My Ave
North<BR>Anywhere, USA</B><BR><BR><B>Phone: 800-111-1111 </B><BR> </TD>
</TR>
<TR VALIGN="MIDDLE">
<TD WIDTH="509" ALIGN="CENTER" VALIGN="MIDDLE" HEIGHT="40"><A
HREF="mailto:kklimarchuk@supremecouncil.org"><IMG SRC="email1.gif" WIDTH="30" HEIGHT="28"
BORDER="0" ALIGN="MIDDLE">me@address.com</A></TD>
</TR>
</TABLE> </BODY>
</HTML>
*************************************
NEED HELP BAD
Reply With Quote
  #2 (permalink)  
Old 08-09-04, 19:24
Seppuku Seppuku is offline
Useless...
 
Join Date: Jul 2003
Location: SoCal
Posts: 721
The first thing I noticed is that you can't have a Response.Redirect after the page has been sent to the browser. Response.Redirects can only be used before any <HTML> or Headers have been sent to the browser.

Second, have you created a mail account on your webserver for CDONTS to use?
__________________
That which does not kill me postpones the inevitable.
Reply With Quote
  #3 (permalink)  
Old 08-10-04, 10:01
Maximus2004 Maximus2004 is offline
Registered User
 
Join Date: Jun 2004
Posts: 8
Hi
Thanks for the reply. Actually, no a mail acct was not set up. I ended up finding out the mail I was testing was sitting in mailpick in IIS. Our IT Admin doesn't know how to config SMTP on the web server...
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

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