|
 |
asp_cdo thread: RE: CDONTS and Email help for newbie!
Message #1 by "kevin w perry" <kperry@c...> on Wed, 7 Mar 2001 15:06:54
|
|
WOW great thanks...I will see what I can do thanks a mill!
> Almost forgot the obvious; apart from the code errors check to make sure
> your server has CDONTS.DLL and everything it needs installed properly.
>
> Jonothon Ortiz
> Senior Web Developer
> Xnext, Inc.
> Ph: xxx.xxx.xxxx
> or 888.84.XNEXT
> http://www.Xnext.com
> mailto:jon@x...
>
> -----Original Message-----
> From: kevin w perry [mailto:kperry@c...]
> Sent: Friday, February 23, 2001 11:57 PM
> To: ASP CDO
> Subject: [asp_cdo] CDONTS and Email help for newbie!
>
>
> Below is the code I used to have an HTML form page post my emailform.asp
> but for some reason I get the following error?
> /-------------------------------------------------
> Server object error 'ASP 0177 : 800401f3'
>
> Server.CreateObject Failed
>
> /webdemoEmail_Form.asp, line 50
>
> Invalid class string
> /---------------------------------------------------
>
> I use the CDONTS command but not sure what or why I am getting errors,
> could some one please explain this in a baby step fashion on what I am
> doing wrong?
>
> Below is the code for the emailform.asp
> /------------------
> <%@LANGUAGE="VBSCRIPT"%>
>
> <html>
> <head>
> <title>webDemoFormEmail</title>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
>
> </head>
>
> <body bgcolor="#FFFFFF" text="#000000">
> <%
>
> Dim Name, SendTo, EMail, Products, comments, phone, fax, Time, demoDate,
> Priority
>
> ' Retrieve contents of EmailAddress field and remove blank spaces
> ' with the Trim method
> Name = Trim(Request.Form("Name"))
>
> ' Set the email address that the message must be posted to.
> SendTo = "kperry@c..."
>
> ' Retrieve contents of Message field and remove blank spaces with the
Trim
> method
> EMail = Trim(Request.Form("EMail"))
>
> ' Retrieve contents of Message field and remove blank spaces with the
Trim
> method
> Products = Trim(Request.Form("Products"))
>
> ' Retrieve contents of Subject field and remove blank spaces with the
Trim
> method
> comments = Trim(Request.Form("comments"))
>
> ' Retrieve contents of Message field and remove blank spaces with the
Trim
> method
> Phone = Trim(Request.Form("Phone"))
>
> ' Retrieve contents of Message field and remove blank spaces with the
Trim
> method
> fax = Trim(Request.Form("fax"))
>
> ' Retrieve contents of Message field and remove blank spaces with the
Trim
> method
> Time = Trim(Request.Form("Time"))
>
> ' Retrieve contents of Message field and remove blank spaces with the
Trim
> method
> demoDate = Trim(Request.Form("demoDate"))
>
> 'Sets the priority of the message
> Priority = 1
>
> ' Test if the From and Message variable are not blank
> If (Name <> "" And EMail <> "") Then
>
> ' Create an instance of the CDONTS.NewMail object
> Set Email = Server.CreateObject("CDONTS.NewMail")
>
> ' Send the email message by passing properties for the NewMail object
> ' directly to the Send method
> Email.Send Name, EMail, Products, comments, phone, fax, time,demoDate,
> Priority, SendTo, Priority
>
> ' Destroy the NewMail object
> Set Email = Nothing
>
> ' Acknowledge that email has been sent
> Response.Write "Thanks for the valuable feedback."
>
> ' The code within the Else statement will only be executed
> ' when the user has left both the email and Message fields blank
> Else
>
> ' Advise user of why the email can't be sent
> Response.Write "You have not completed all of the required details."
>
> End If
>
> %>
> <p align="center"> </p>
> <p> </p>
> <p>
> </p>
> </body>
> </html>
>
|
|
 |