CDO error 8004020f

Discussion in 'ASP General' started by alex, Oct 3, 2003.

  1. alex

    alex Guest

    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 = ""
    msg.From = ""
    msg.Subject = "Test - " & now()
    msg.TextBody = "Test message - " & now()
    msg.Send

    set msg = nothing
    alex, Oct 3, 2003
    #1
    1. Advertising

  2. alex

    Ray at Guest

    And what is the description of this 8004020f error?

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

    Ray at work

    "alex" <> wrote in message
    news:...
    > 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 = ""
    > msg.From = ""
    > msg.Subject = "Test - " & now()
    > msg.TextBody = "Test message - " & now()
    > msg.Send
    >
    > set msg = nothing
    >
    >
    Ray at, Oct 3, 2003
    #2
    1. Advertising

  3. alex

    alex Guest

    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

    "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    news:...
    > And what is the description of this 8004020f error?
    >
    > Does IUSR have permissions to write files to \inetpub\mailroot\pickup?
    >
    > Ray at work
    >
    > "alex" <> wrote in message
    > news:...
    > > 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 = ""
    > > msg.From = ""
    > > msg.Subject = "Test - " & now()
    > > msg.TextBody = "Test message - " & now()
    > > msg.Send
    > >
    > > set msg = nothing
    > >
    > >

    >
    >
    alex, Oct 3, 2003
    #3
  4. alex

    Ray at Guest

    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

    "alex" <> wrote in message
    news:...
    > 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
    >
    Ray at, Oct 3, 2003
    #4
  5. alex

    alex Guest

    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!

    "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    news:...
    > 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
    >
    > "alex" <> wrote in message
    > news:...
    > > 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
    > >

    >
    >
    alex, Oct 3, 2003
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. vvv

    just error 8004020f

    vvv, Nov 5, 2003, in forum: ASP General
    Replies:
    1
    Views:
    145
    Aaron Bertrand - MVP
    Nov 5, 2003
  2. Paco
    Replies:
    4
    Views:
    418
    Jeff Cochran
    Mar 30, 2005
  3. Owen
    Replies:
    6
    Views:
    377
    Yan-Hong Huang[MSFT]
    Feb 20, 2004
  4. Luis

    8004020F error with CDO.Message

    Luis , Jul 27, 2004, in forum: ASP General
    Replies:
    1
    Views:
    342
    Rob Collyer
    Jul 27, 2004
  5. gariboldo

    error 8004020F

    gariboldo, Feb 2, 2005, in forum: ASP General
    Replies:
    0
    Views:
    107
    gariboldo
    Feb 2, 2005
Loading...

Share This Page