Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 10th, 2004, 09:27 PM
Authorized User
 
Join Date: Jan 2004
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Default What's wrong with this???

Here is the code:

Dim objCDO
    Set objCDO = Server.CreateObject("CDONTS.NewMail") objCDO.From = Request.Form("EVE_EMAIL")
    objCDO.To = myEmail
    objCDO.CC = Request.Form("EVE_EMAIL")
    objCDO.Subject = "New event has been submited"
    objCDO.Body = "A new event has been submited and needs to be approved." & vbnewline & "Event Name: " & Request.Form("EVE_NAME") & vbnewline & "Event Description: " & Request.Form("EVE_DESCRIPTION") & vbnewline & "Submited By: " & Request.Form("EVE_EMAIL")
    objCDO.Send()
    Set objCDO = Nothing

(in red is the problem line)

Here is the error:

Server object error 'ASP 0177 : 800401f3'

Server.CreateObject Failed

/schoolcalendar/inc_submit.asp, line 140

800401f3

Can someone please help??? There is a bunch of code before that, so if that will help, I can put that up here too! Let me know!

 
Old May 11th, 2004, 02:25 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

On what OS are you running this? Are you sure CDONTS is available?

Check out the CDONTS Introduction page and dig around a bit to read more about the requirements and options you have.
Depending on your OS and requirements, you could use CDO instead of CDONTS.
Check out the Collaboration Data Objects page for more information about the different CDO objects available.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Pure Pleasure Seeker by Moloko (Track 2 from the album: Things To Make And Do) What's This?
 
Old May 12th, 2004, 07:22 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

I would recommend using CDOSYS if you have a Win2K box. Here is an example that uses authentication to send.

<!--METADATA TYPE="typelib"
UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
NAME="CDO for Windows 2000 Library" -->
<!--METADATA TYPE="typelib"
UUID="00000205-0000-0010-8000-00AA006D2EA4"
NAME="ADODB Type Library" -->
<html>
<head>
<title>email</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<%
strLastName = Request("lastname")
strFirstName = Request("firstname")
strPhone = Request("phone")
strEmail = Request("emailfrom")
strDepartment = Request("department")
strOffice = Request("office")
strSummary = Request("summary")
strDetail = Request("detail")

%>
<%
Dim objMessage, objConfig

Set objMessage = CreateObject("CDO.Message")
Set objConfig = CreateObject("CDO.Configuration")

'Configuration:
objConfig.Fields(cdoSendUsingMethod) = cdoSendUsingPort
objConfig.Fields(cdoSMTPServer) = "removed"
objConfig.Fields(cdoSMTPServerPort) = 25
objConfig.Fields(cdoSMTPAuthenticate) = 2 '2 for authentication
objConfig.Fields(cdoSendUserName) = "domain\username"
objConfig.Fields(CdoSendPassword) = "password"

'Update configuration
objConfig.Fields.Update
Set objMessage.Configuration = objConfig

'Make message
objMessage.To = "removed"
'objMessage.Cc = "[email protected]"
'objMessage.Bcc = "[email protected]"
objMessage.From = strEmail
objMessage.ReplyTo = strEmail
objMessage.Subject = "HelpDesk -QuickForm"
objMessage.TextBody = strDetail & " " & "Phone:" & strPhone
objMessage.HtmlBody = "<html><body>" & "<b>A Helpdesk Request submitted by:</b> " & strFirstName &_
" " & strLastName & "<br><br><b>Problem description:</b> " & strDetail & "<br><b>Email address:</b> " & strEmail &_
"<br><br><b>Department:</b> " & strDepartment & "<br><b>Phone Number:</b> " & strPhone &_
"<br><b>My office hours are:</b> " & strOffice &_
    "<br><br>***************************************** *****************<br>Quick HelpDesk Form" & "</body></html>"

' Error Handling
On Error Resume Next

' Send the CDOSYS Message
objMessage.Send
Set objMessage = Nothing
Set objConfig = Nothing

' Display success message or error
If Err.Number = 0 Then
Response.Write("<script language=""JavaScript"">var msg = ""Message Sent!""; alert(msg);</script>")

Response.Write("<body onLoad=""location.href('rightside.asp')"">")
Else
Response.Write Err.Description & ""
Err.Number = 0
End If
On Error Goto 0

%>
</body>
</html>





Similar Threads
Thread Thread Starter Forum Replies Last Post
What's wrong ??? FT BOOK: ASP.NET Website Programming Problem-Design-Solution 2 November 3rd, 2005 09:18 AM
Help..What am I doing wrong... Brettvan1 VB.NET 2002/2003 Basics 2 October 18th, 2004 02:36 AM
Where did I go wrong??? ahc2inc VB.NET 2002/2003 Basics 3 September 28th, 2004 08:19 PM
What's wrong?Help! amu BOOK: Beginning ASP.NET 1.0 1 October 28th, 2003 08:21 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.