Wrox Programmer Forums
|
ASP CDO As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP CDO 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 September 13th, 2004, 04:38 PM
Authorized User
 
Join Date: Sep 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default CDO error sending mail

This site worked on Windows 2000, but after I moved it to W2K3, I get this error whenever I have a Server.CreateObject command. This is the error:

Server object error 'ASP 0177 : 800401f3'

Server.CreateObject Failed

/contact/default.asp, line 15

800401f3



Here is part of my code:

<%sHeading = "Contact Us"%>
<%sTitle = "Company name: Contact Us"%>



<%
if Request("submitted") = 1 then
  BodyText = "<b>Name:</b> " & Request("name") & "<br>" &_
            "<b>Email Address:</b> " & Request("email") & "<br>" &_
            "<b>Phone Number:</b> " & Request("phone") & "<br>" &_
            "<b>Address:</b> " & Request("address") & "<br>" &_
            "<b>Company:</b> " & Request("Company") & "<br>" &_
            "<b>Comment:</b><br> " & Request("comment") & "<br>"

  Set oMailMessage = Server.CreateObject("CDO.NewMail")
    oMailMessage.from = "SignUp@Company name.net"
    oMailMessage.to = "SignUp@Company name.net, apps@Company name.net"
    oMailMessage.subject = "Contact Agent: Contact Requested"
    oMailMessage.MailFormat = 0
    oMailMessage.BodyFormat = 0 ' HTML
    oMailMessage.body = BodyText
    oMailMessage.Send()
%>


I have spend days searching the MS KB and Google to no avail.

I have seen a lot of similar issues but no one ever had a solution.

 
Old September 13th, 2004, 07:01 PM
Friend of Wrox
 
Join Date: May 2003
Posts: 202
Thanks: 0
Thanked 1 Time in 1 Post
Default

CDONTS is no longer part of W2K3.

You'll need to migrate to CDOSYS.

Bruce Luckcuck
Director, Applications & Support Services
Wiley Publishing, Inc.
 
Old September 13th, 2004, 07:37 PM
Authorized User
 
Join Date: Sep 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

So I need to change

Set oMailMessage = Server.CreateObject("CDO.NewMail")

to

Set oMailMessage = Server.CreateObject("CDOSYS.NewMail") ?

 
Old September 13th, 2004, 08:09 PM
Authorized User
 
Join Date: Sep 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well, I changed all applicable entries to CDOSYS and still had the same error.

Any other ideas? I'm getting kind of desperate.

 
Old September 13th, 2004, 10:06 PM
Friend of Wrox
 
Join Date: May 2003
Posts: 202
Thanks: 0
Thanked 1 Time in 1 Post
Default

CDOSYS is a different animal then CDONTS - you have to migrate your code to it, not just substitue the text. It's not hard though.

See that search box in the upper right-hand corner of the page. Type CDOSYS in there and click GO. You'll find a number of topics that will help.

Here's one to get you started.

Also, Google is your friend.

Bruce Luckcuck
Director, Applications & Support Services
Wiley Publishing, Inc.
 
Old September 14th, 2004, 06:05 PM
Authorized User
 
Join Date: Sep 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

After a lot of reading of the materials you listed, I found the solution. I made the change and it works with only one slight problem. I have three identical web sites on this server and I made the change to all of them. When I execute the code, 2 of them send mail from their own SMTP server on the web site to their own Exchange server; one of them sends the e-mail to the DROP folder. I've been unable to figure out why. I've deleted and recreated the SMTP Virtual server with no change.

Here's my new code:

<%sHeading = "Contact Us"%>
<%sTitle = "Company Name: Contact Us"%>



<%
'Create the e-mail server object
if Request("submitted") = 1 then
  BodyText = "<b>Name:</b> " & Request("name") & "<br>" &_
            "<b>Email Address:</b> " & Request("email") & "<br>" &_
            "<b>Phone Number:</b> " & Request("phone") & "<br>" &_
            "<b>Address:</b> " & Request("address") & "<br>" &_
            "<b>Company:</b> " & Request("Company") & "<br>" &_
            "<b>Comment:</b><br> " & Request("comment") & "<br>"

Set objCDOSYSMail = Server.CreateObject("CDO.Message")
Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")
'Out going SMTP server
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "192.168.1.178"
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
objCDOSYSCon.Fields.Update

'Update the CDOSYS Configuration
Set objCDOSYSMail.Configuration = objCDOSYSCon
objCDOSYSMail.From = "SignUp@Company Name.net"
objCDOSYSMail.To = "SignUp@Company Name.net"
objCDOSYSMail.Subject = "Contact Agent: Contact Requested"
objCDOSYSMail.HTMLBody = BodyText
objCDOSYSMail.Send
'Close the server mail object
Set objCDOSYSMail = Nothing
Set objCDOSYSCon = Nothing







Similar Threads
Thread Thread Starter Forum Replies Last Post
Error when sending mail using the AjaxMail example MightyThor BOOK: Professional Ajax ISBN: 978-0-471-77778-6 3 June 23rd, 2006 04:11 AM
error sending email with attachment using CDO archanahs Classic ASP Professional 1 May 25th, 2006 08:16 AM
Mail sending error rajuru Beginning PHP 3 October 20th, 2004 01:19 AM
URGENT Error in sending mail qazi_nomi Classic ASP Basics 12 June 25th, 2004 07:42 PM
Urgent Error in sending mail qazi_nomi Classic ASP Components 1 June 11th, 2004 02:49 AM





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