Solved

Sending email from Windows server 2003

Posted on 2004-04-10
8
845 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
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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now