Go Back   CodingForums.com > :: Server side development > ASP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-23-2012, 07:16 PM   PM User | #1
SteveH
Regular Coder

 
Join Date: Nov 2005
Posts: 615
Thanks: 91
Thanked 1 Time in 1 Post
SteveH is an unknown quantity at this point
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:

Quote:
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.
SteveH is offline   Reply With Quote
Old 06-24-2012, 02:48 AM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,185
Thanks: 59
Thanked 3,995 Times in 3,964 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
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.
Old Pedant is offline   Reply With Quote
Old 06-24-2012, 01:23 PM   PM User | #3
SteveH
Regular Coder

 
Join Date: Nov 2005
Posts: 615
Thanks: 91
Thanked 1 Time in 1 Post
SteveH is an unknown quantity at this point
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
SteveH is offline   Reply With Quote
Old 06-25-2012, 01:49 AM   PM User | #4
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,185
Thanks: 59
Thanked 3,995 Times in 3,964 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
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
Quote:
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.
Old Pedant is offline   Reply With Quote
Old 07-02-2012, 07:40 PM   PM User | #5
SteveH
Regular Coder

 
Join Date: Nov 2005
Posts: 615
Thanks: 91
Thanked 1 Time in 1 Post
SteveH is an unknown quantity at this point
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:

Quote:
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.
SteveH is offline   Reply With Quote
Old 07-03-2012, 03:53 AM   PM User | #6
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,185
Thanks: 59
Thanked 3,995 Times in 3,964 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
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.
Old Pedant is offline   Reply With Quote
Old 07-04-2012, 05:15 AM   PM User | #7
gnoix
New to the CF scene

 
Join Date: Jul 2012
Location: australia
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
gnoix is an unknown quantity at this point
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
gnoix is offline   Reply With Quote
Old 07-04-2012, 11:41 PM   PM User | #8
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,185
Thanks: 59
Thanked 3,995 Times in 3,964 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
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.
Old Pedant is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:19 AM.


Advertisement
Log in to turn off these ads.