Solved

Sending email from Windows server 2003

Posted on 2004-04-10
8
852 Views
Last Modified: 2012-06-27
Hello experts

I need to be able to send mail from an ASP page that's hosted on a Windows Server 2003 (Standard edition) server.

The code used to work fine on Windows 2000 server.

The SMTP server is installed and I can telnet to it on port 25.

I get the following error:

---------------------------------------------------------------------------------
Server object error 'ASP 0177 : 800401f3'

Server.CreateObject Failed

mailer.asp, line 13

800401f3
---------------------------------------------------------------------------------

I have tried both:

     Dim objMail
     Set objMail = Server.CreateObject("CDONTS.NewMail")

---- AND ----

     Dim objMail
     Set objMail = Server.CreateObject("CDO.Message")

no joy. What am I doing wrong?


Thanks for your help

- Hans
0
Comment
Question by:hans_larson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 21

Expert Comment

by:ap_sajith
ID: 10796316
You do not have either of the two components installed on the server. Check up with your sys admin / Hosting provider whether the components are available for use (In other words check if the components are installed on the server).

Cheers!!
0
 
LVL 3

Author Comment

by:hans_larson
ID: 10796373
ap_sajith,

The components were installed.

It appears that you have to create the ("CDO.Configuration") object first before you can create the ("CDO.Message") object.

Here is the solution:

Put the following code into a new asp page:

---------------------------------------------------------------------

<%
    sch = "http://schemas.microsoft.com/cdo/configuration/
    Set cdoConfig = Server.CreateObject("CDO.Configuration")
    cdoConfig.Fields.Item(sch & "sendusing") = 2
    cdoConfig.Fields.Item(sch & "smtpserver") = "192.168.0.1"
    cdoConfig.fields.update
 
    Set cdoMessage = Server.CreateObject("CDO.Message")
    Set cdoMessage.Configuration = cdoConfig
    cdoMessage.From = "from@me.com"
    cdoMessage.To = "to@me.com"
    cdoMessage.Subject = "Sample CDONTS NewMail"
    cdoMessage.TextBody = "This is a test for CDONTS message"
    cdoMessage.Send
    Set cdoMessage = Nothing
    Set cdoConfig = Nothing
%>


---------------------------------------------------------------------------------


Also be sure the allowing relaying on your SMTP server properties.
0
 
LVL 1

Expert Comment

by:icx
ID: 10797049
I agree.

Hans_Larson's comment should work fine. There's more on this over at Microsoft's KB. This article might help you, or at least point you in a useful direction: http://support.microsoft.com/default.aspx?scid=kb;en-us;315197.

Hope this helps.

Cheers.
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
LVL 10

Expert Comment

by:MasseyM
ID: 10797541
You basicalyl dont have CDO installed.  Go to the site below, download this ASP code and it willscan the server for ALL components installed.  Fnd and choose which mail app you prefer and use that to send your mail:

http://www.bier-voting.de/objcheck/
0
 
LVL 10

Expert Comment

by:MasseyM
ID: 10798162
Why was the request made??  These are all good answers.
0
 
LVL 3

Author Comment

by:hans_larson
ID: 10799744
MasseyM,

Notice the second and correct answer was made by myself.
0
 
LVL 1

Accepted Solution

by:
GhostMod earned 0 total points
ID: 10823964
PAQd, 50 points refunded.

GhostMod
Community Support Moderator
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question