Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    Regular Coder
    Join Date
    Nov 2005
    Posts
    750
    Thanks
    138
    Thanked 1 Time in 1 Post

    Error '8004020f' = smtp error?

    Hello

    I have a 'register your email and login' script which uses an Access db. When I register a mock account I get an error:

    error '8004020f'
    /register.asp, line 93
    Line 93 says:
    Code:
    objCDOSYSMail.Send
    My Web hosting service uses SMTP and so in the original script, where it said:

    Code:
    objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = vEmailServer
    , I have had to dim vEmailServer (which means nothing to my server) to equal that of my own smtp server as:

    vEmailServer = "smtp.mySite.com"

    I have had to declare this at the top of three asp pages in the log-in script where vEmailServer occurs.

    Is it likely that this is the cause of the error and, if so, how can I get round this please?

    Thanks for any ideas.

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,200
    Thanks
    75
    Thanked 4,342 Times in 4,308 Posts
    It well could be the problem.

    Your host should be able to tell you what the proper server to use is.

    For example, if your host is GoDaddy, the server is then *ALWAYS* "relay-hosting.secureserver.net" no matter what your site is.

    Don't guess at the right value. Ask your host.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #3
    Regular Coder
    Join Date
    Nov 2005
    Posts
    750
    Thanks
    138
    Thanked 1 Time in 1 Post
    Hello Old Pedant

    I know the value is smtp.mySite.com, so I tried to ensure that the line in the original script, that is

    Code:
    objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = vEmailServer
    was accounted for by

    dim vEmailServer

    vEmailServer = "smtp.mySite.com"

    I have had to do this in a couple of places, but the log-in script taken as a whole doesn't seem happy with it.

    Steve

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,200
    Thanks
    75
    Thanked 4,342 Times in 4,308 Posts
    It would make NO DIFFERENCE if you did
    Code:
    dim vEmailServer
    vEmailServer = "smtp.mySite.com
    objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = vEmailServer
    or you more simply and reasonably coded
    Code:
    objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.mySite.com"
    I have no idea what you could possibly mean by
    log-in script taken as a whole doesn't seem happy with it.
    other than what you showed as the error message.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #5
    Regular Coder
    Join Date
    Nov 2005
    Posts
    750
    Thanks
    138
    Thanked 1 Time in 1 Post
    Hello Old Pedant

    Sorry for the delay in replying, but I have been out of action for a few days.

    I have changed four ASP files so that vEmailServer has now become "smtp.mySite.com" and uploaded them to my server. I go to www.mySite.com/register.asp where a 'Register here' dialogue box appears that asks me for my username, password, and email address, and this is the error I now receive:

    error '8004020f'
    /register.asp, line 91
    Line 91 of register.asp refers to this:
    Code:
    objCDOSYSMail.Send
    I don't think there is anything wrong with that line in itself, so what would you recommend as a starting point to get to the bottom of this?

    Thanks.

  • #6
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,200
    Thanks
    75
    Thanked 4,342 Times in 4,308 Posts
    Same answer as before: The most likely candidate is that line you showed before, where you set the SMTP server.

    Either that's not the right SMTP server or the SMTP server is not turned on for that host or or or ...

    Again, ask your host, if this is a shared server. If it's your own server, check to make sure SMTP is running.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #7
    New to the CF scene
    Join Date
    Jul 2012
    Location
    australia
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    based on the error message, your host absolutely enable SMTP authentication for any outgoing email in order to prevent spamming activity on their mail server.

    I may suggest you to ask your host to provide you the valid SMTP server.
    Basically, it should be mail.yourdomainame.com.
    the default SMTP port is 25, but make sure this port is allowed and there is always an alternate SMTP port you can use (ask your host)
    and then use the valid username user@yourdomain.com and its password
    the most important thing is to make sure that your domain DNS has been pointed to the correct record

  • #8
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,200
    Thanks
    75
    Thanked 4,342 Times in 4,308 Posts
    gnoix may be going overboard. Not all SMTP servers require username and password. Usually, those on a dedicated server do not, as they can easily reject any requests from outside the server itself. So, again, ask your host.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •