Re: cdont
From: Glenn (nospam_at_yahoo.com)
Date: 02/20/05
- Next message: Glenn: "Re: cdont"
- Previous message: Thomas A. Rowe: "Re: cdont"
- In reply to: Kathleen Anderson [MVP - FrontPage]: "Re: cdont"
- Next in thread: Thomas A. Rowe: "Re: cdont"
- Reply: Thomas A. Rowe: "Re: cdont"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 20 Feb 2005 10:02:17 -0500
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'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...
>>> 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 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.
>>>>
>>>>
>>>>
>>
>>
>
>
- Next message: Glenn: "Re: cdont"
- Previous message: Thomas A. Rowe: "Re: cdont"
- In reply to: Kathleen Anderson [MVP - FrontPage]: "Re: cdont"
- Next in thread: Thomas A. Rowe: "Re: cdont"
- Reply: Thomas A. Rowe: "Re: cdont"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|