[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 855
  • Last Modified:

Sending email from Windows server 2003

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
hans_larson
Asked:
hans_larson
1 Solution
 
ap_sajithCommented:
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
 
hans_larsonAuthor Commented:
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
 
icxCommented:
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
MasseyMCommented:
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
 
MasseyMCommented:
Why was the request made??  These are all good answers.
0
 
hans_larsonAuthor Commented:
MasseyM,

Notice the second and correct answer was made by myself.
0
 
GhostModCommented:
PAQd, 50 points refunded.

GhostMod
Community Support Moderator
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now