CDO error 8004020f

A

alex

Hi,

Does anybody have an idea why is this happening. The following code works
great on my development machine (windows 2000 pro), but on the test server
(Windows 2000 Server) it can only send emails to addresses on our domain. If
I specify other address I just get a 8004020f error message. The smtp server
I'm trying to send is on a separate machine (Windows NT Server).
I think it has something to do with web server configuration, or even maybe
smtp server? But the fact that I can send it from my machine throws me
off... I also tried a Perl script to send email using the same smtp server
and I have the same problem, works from my machine, fails on test server.
Anyone came across something like that?

Thanks,
Alex

Code follows:

Set msg = Server.CreateObject("CDO.Message")

Dim iConf
Set iConf = CreateObject("CDO.Configuration")
Dim Flds
Set Flds = iConf.Fields
Flds("http://schemas.microsoft.com/cdo/configuration/Sendusing") = 2
Flds("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"11.11.111.11" 'real IP actually used
Flds("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

Flds.Update

Set msg.Configuration = iConf
'Works on my machine, but fails on the server.
msg.To = "(e-mail address removed)"
msg.From = "(e-mail address removed)"
msg.Subject = "Test - " & now()
msg.TextBody = "Test message - " & now()
msg.Send

set msg = nothing
 
R

Ray at

And what is the description of this 8004020f error?

Does IUSR have permissions to write files to \inetpub\mailroot\pickup?

Ray at work
 
A

alex

Thanks for the reply. It doesn't actually give me an error description just:
error '8004020f'
/mailtest.asp, line 42

The smtp server is not the default smtp server on the web server, but i
specify the IP address of a different SMTP server (on separate machine). So
i don't think it event uses those directories. And i can send it to emails
on our domain, but not to email on other domains.

I forgot to mention that the SMTP server is Eudora WorldMail on windows nt
server. But CDO should work with any SMTP server... and it sucessfully sends
emails to my domain...

Thanks,
alex
 
R

Ray at

It sounds like a SMTP relaying permissions problem. Does your SMTP server
allow relaying to other domains of e-mails that originate from your IIS
server's IP?

Ray at work
 
A

alex

Thanks Ray,

Relaying was the problem. My machine goes through a proxy server and the
proxy's IP address was on the allowed list for relaying, that's why it
worked on my machine. After we added web server IP address to allow list, it
works as expected.

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top