|
Home > Archive > FrontPage Server Extensions for Windows > February 2005 > cdont
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
|
| I had the same problem. So, I went and bought a book called active server
pages in 24 hours. The website for the book was http://www.asp24h.com. It is
a book companion website.
| |
|
|
|
| So were you able to figure it out using the book?
"svant" <svant@discussions.microsoft.com> wrote in message
news:F00C086F-27E2-40F9-83DF-92E75D0D0FB1@microsoft.com...
>I had the same problem. So, I went and bought a book called active server
> pages in 24 hours. The website for the book was http://www.asp24h.com. It
> is
> a book companion website.
| |
|
| Chapter 11 Helped me out with the basic and explained in details. Then I add
more form fields. I looked at how the string matched the form field and
corresponded. It was really easy.
"Glenn" wrote:
> So were you able to figure it out using the book?
> "svant" <svant@discussions.microsoft.com> wrote in message
> news:F00C086F-27E2-40F9-83DF-92E75D0D0FB1@microsoft.com...
>
>
>
| |
|
| I've narrowed my problem down. It is definitely the e-mail portion using
CDONTS that isn't working. When I take that section of the code out,
everything works fine - the data goes to the database, etc.
When I try having just the CDONTS code in to send to e-mail, I get the page
can't be found message.
Any suggestions?
I did buy the book you mentioned last night.
"svant" <svant@discussions.microsoft.com> wrote in message
news:E4F8A697-296D-48A9-9D45-8A0CBDF03514@microsoft.com...[vbcol=seagreen]
> Chapter 11 Helped me out with the basic and explained in details. Then I
> add
> more form fields. I looked at how the string matched the form field and
> corresponded. It was really easy.
>
> "Glenn" wrote:
>
| |
| Kathleen Anderson [MVP - FrontPage] 2005-02-20, 6:12 pm |
| Can you post your code with the email portion?
--
~ Kathleen Anderson
Microsoft MVP - FrontPage
Spider Web Woman Designs
web: http://www.spiderwebwoman.com/resources/
blog: http://msmvps.com/spiderwebwoman/category/321.aspx
"Glenn" <nospam@yahoo.com> wrote in message
news:Oyldao1FFHA.3928@TK2MSFTNGP15.phx.gbl...
> I've narrowed my problem down. It is definitely the e-mail portion using
> CDONTS that isn't working. When I take that section of the code out,
> everything works fine - the data goes to the database, etc.
>
> When I try having just the CDONTS code in to send to e-mail, I get the
> page can't be found message.
>
> Any suggestions?
>
> I did buy the book you mentioned last night.
> "svant" <svant@discussions.microsoft.com> wrote in message
> news:E4F8A697-296D-48A9-9D45-8A0CBDF03514@microsoft.com...
>
>
| |
| Thomas A. Rowe 2005-02-20, 6:12 pm |
| If your site is hosted on a Windows 2003 server, then CDONTS is not available unless the web host
has installed it from Windows 2000 server. Under Windows 2003 you would use CDOYSYS instead, which
is also available on Windows 2000 server. The coding for this is different from CDONTS. You can find
code sample by typing the following into the IE address bar:
? ASP Sending Mail with CDOSYS
--
========================================
======
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)
http://www.ycoln-resources.com
FrontPage Resources, WebCircle, MS KB Quick Links, etc.
========================================
======
To assist you in getting the best answers for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp
"Glenn" <nospam@yahoo.com> wrote in message news:Oyldao1FFHA.3928@TK2MSFTNGP15.phx.gbl...
> I've narrowed my problem down. It is definitely the e-mail portion using CDONTS that isn't
> working. When I take that section of the code out, everything works fine - the data goes to the
> database, etc.
>
> When I try having just the CDONTS code in to send to e-mail, I get the page can't be found
> message.
>
> Any suggestions?
>
> I did buy the book you mentioned last night.
> "svant" <svant@discussions.microsoft.com> wrote in message
> news:E4F8A697-296D-48A9-9D45-8A0CBDF03514@microsoft.com...
>
>
| |
|
| Sure, here it is: (note that I changed my email to me@me.com in this posting
to avoid spam. In the actual code I have my real e-mail). I am sort of
wondering if this problem could be because I am running an exchange server
(2000) on my Windows 2000 server, and in IIS there is no Default SMTP server
listed (though I have one in Exchange).
'=======================================
============================
' Send the results to e-mail.
' Use CDONTS to create and send a message based on information
' entered into the form. The following lines compose and send
' the e-mail.
'=======================================
============================
'=======================================
=============================
' Set up variables:
' myCDONTSMail = A CDONTS mail object.
' strFrom = A string containing the source e-mail address.
' strTo = A string containing the destination e-mail address.
' strSubject = A string containing the subject of the e-mail.
' strBody = A string containing the body of the e-mail.
'=======================================
=============================
Dim myCDONTSMail
Dim strFrom
Dim strTo
Dim strSubject
Dim strBody
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
' Assign the source e-mail address. Change this to your e-mail
' address.
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
strFrom="me@me.com"
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
' Assign the destination e-mail address. In this example, get the
' e-mail address from the form field called "EMail".
' You can customize this by removing the EMail form field and
' changing the following line to this:
' strTo="me@me.com" ? Change this to your e-mail
' address.
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
strTo=Request.Form("EMail")
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
' The following line is the subject of the e-mail. You can change
' this to a subject that is customized to your liking.
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
strSubject = "Send to E-mail and Database"
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
' The following lines create the body of the message. This can be
' anything you want it to be.
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
strBody="The following information was submitted:" & Chr(13)
strBody = strBody & Request.Form("FirstName") & " "
strBody = strBody & Request.Form("LastName")
strBody = strBody & Chr(13) & Request.Form("Address") & Chr(13)
strBody = strBody & Request.Form("City") & Chr(13)
strBody = strBody & Request.Form("Region") & Chr(13)
strBody = strBody & Request.Form("PostalCode") & Chr(13)
strBody = strBody & Chr(13) & "Thank you for submitting your data."
'=======================================
=============================
' The SET statement creates the CDONTS mail object in preparation
' for sending the e-mail message.
'=======================================
=============================
Set myCDONTSMail = CreateObject("CDONTS.NewMail")
'=======================================
=============================
' The following line sends the mail message using the source e-mail,
' destination e-mail, subject, and body that were defined earlier.
'=======================================
=============================
myCDONTSMail.Send strFrom,strTo,strSubject,strBody
'=== Set the CDONTS mail object to NOTHING to free resources.
Set myCDONTSMail = Nothing
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
' For information about how to customize the rest of this page, see the
' Customizing the Confirmation Page section of this document. Sections
' that are discussed in the Customizations section are delimited
' by percent signs.
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%>
"Kathleen Anderson [MVP - FrontPage]" <spiderwebwoman@mvps.org> wrote in
message news:OBuXKw1FFHA.3732@TK2MSFTNGP14.phx.gbl...
> Can you post your code with the email portion?
>
> --
> ~ Kathleen Anderson
> Microsoft MVP - FrontPage
> Spider Web Woman Designs
> web: http://www.spiderwebwoman.com/resources/
> blog: http://msmvps.com/spiderwebwoman/category/321.aspx
>
>
>
> "Glenn" <nospam@yahoo.com> wrote in message
> news:Oyldao1FFHA.3928@TK2MSFTNGP15.phx.gbl...
>
>
| |
|
| I am using a Windows 2000 Server
"Thomas A. Rowe" <tarowe@mvps.org> wrote in message
news:ejkuU01FFHA.3244@TK2MSFTNGP15.phx.gbl...
> If your site is hosted on a Windows 2003 server, then CDONTS is not
> available unless the web host has installed it from Windows 2000 server.
> Under Windows 2003 you would use CDOYSYS instead, which is also available
> on Windows 2000 server. The coding for this is different from CDONTS. You
> can find code sample by typing the following into the IE address bar:
>
> ? ASP Sending Mail with CDOSYS
>
> --
> ========================================
======
> Thomas A. Rowe (Microsoft MVP - FrontPage)
> WEBMASTER Resources(tm)
> http://www.ycoln-resources.com
> FrontPage Resources, WebCircle, MS KB Quick Links, etc.
> ========================================
======
> To assist you in getting the best answers for FrontPage support see:
> http://www.net-sites.com/sitebuilder/newsgroups.asp
>
> "Glenn" <nospam@yahoo.com> wrote in message
> news:Oyldao1FFHA.3928@TK2MSFTNGP15.phx.gbl...
>
>
| |
| Thomas A. Rowe 2005-02-20, 6:12 pm |
| Since you are using Exchange Server, you might want to post to the Exchange newsgroup.
--
========================================
======
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)
http://www.ycoln-resources.com
FrontPage Resources, WebCircle, MS KB Quick Links, etc.
========================================
======
To assist you in getting the best answers for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp
"Glenn" <nospam@yahoo.com> wrote in message news:ehLht01FFHA.1476@TK2MSFTNGP09.phx.gbl...
> Sure, here it is: (note that I changed my email to me@me.com in this posting to avoid spam. In
> the actual code I have my real e-mail). I am sort of wondering if this problem could be because I
> am running an exchange server (2000) on my Windows 2000 server, and in IIS there is no Default
> SMTP server listed (though I have one in Exchange).
>
>
>
> '=======================================
============================
> ' Send the results to e-mail.
> ' Use CDONTS to create and send a message based on information
> ' entered into the form. The following lines compose and send
> ' the e-mail.
> '=======================================
============================
>
> '=======================================
=============================
> ' Set up variables:
> ' myCDONTSMail = A CDONTS mail object.
> ' strFrom = A string containing the source e-mail address.
> ' strTo = A string containing the destination e-mail address.
> ' strSubject = A string containing the subject of the e-mail.
> ' strBody = A string containing the body of the e-mail.
> '=======================================
=============================
> Dim myCDONTSMail
> Dim strFrom
> Dim strTo
> Dim strSubject
> Dim strBody
>
> '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> ' Assign the source e-mail address. Change this to your e-mail
> ' address.
> '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> strFrom="me@me.com"
>
> '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> ' Assign the destination e-mail address. In this example, get the
> ' e-mail address from the form field called "EMail".
> ' You can customize this by removing the EMail form field and
> ' changing the following line to this:
> ' strTo="me@me.com" ? Change this to your e-mail
> ' address.
> '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> strTo=Request.Form("EMail")
>
> '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> ' The following line is the subject of the e-mail. You can change
> ' this to a subject that is customized to your liking.
> '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> strSubject = "Send to E-mail and Database"
>
> '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> ' The following lines create the body of the message. This can be
> ' anything you want it to be.
> '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> strBody="The following information was submitted:" & Chr(13)
> strBody = strBody & Request.Form("FirstName") & " "
> strBody = strBody & Request.Form("LastName")
> strBody = strBody & Chr(13) & Request.Form("Address") & Chr(13)
> strBody = strBody & Request.Form("City") & Chr(13)
> strBody = strBody & Request.Form("Region") & Chr(13)
> strBody = strBody & Request.Form("PostalCode") & Chr(13)
> strBody = strBody & Chr(13) & "Thank you for submitting your data."
>
> '=======================================
=============================
> ' The SET statement creates the CDONTS mail object in preparation
> ' for sending the e-mail message.
> '=======================================
=============================
> Set myCDONTSMail = CreateObject("CDONTS.NewMail")
>
> '=======================================
=============================
> ' The following line sends the mail message using the source e-mail,
> ' destination e-mail, subject, and body that were defined earlier.
> '=======================================
=============================
> myCDONTSMail.Send strFrom,strTo,strSubject,strBody
>
> '=== Set the CDONTS mail object to NOTHING to free resources.
> Set myCDONTSMail = Nothing
>
>
> '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> ' For information about how to customize the rest of this page, see the
> ' Customizing the Confirmation Page section of this document. Sections
> ' that are discussed in the Customizations section are delimited
> ' by percent signs.
> '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>
> %>
>
> "Kathleen Anderson [MVP - FrontPage]" <spiderwebwoman@mvps.org> wrote in message
> news:OBuXKw1FFHA.3732@TK2MSFTNGP14.phx.gbl...
>
>
| |
|
| The only thin I don't see in your script is the form action
<FORM ACTION="<%=Request.ServerVariables("SCRIPT_NAME")%>" METHOD=POST>
Then also after the form
</FORM>
<% End If %>
or this option at the top of your script
<%
if Request.Querystring("isSubmitted") = "yes" then
Then the form needs to have this action in
<form action="confirm.asp" method="get" name="Input_Form">
First Name:
<input type="text" size="30"
maxlength="50" name="First_Name">
<br>
Last Name:
<input type="text" size="30"
maxlength="50" name="Last_Name">
<br>
<input type="hidden" name="isSubmitted" value="yes">
<input type="submit" value="Submit Form">
</form>
This part of the form is important to give the
(Request.Querystring("isSubmitted")) the value of less to process.
<input type="hidden" name="isSubmitted" value="yes">
<input type="submit" value="Submit Form">
I hope this helps. I run Windows 2000 Server and CDONTS work for me.
|
|
|
|
|