Error 8004020f when using CDOSYS

Error 8004020f when using CDOSYS

am 14.07.2007 21:07:49 von Larry D

I have a client with a site that users can register at, we collect their
emails, if they have one, in an Access db. I have a page that uses CDOSYS to
send messages to those emails but I am getting "error '8004020f" when I do
this. About 75% of the members have emails so some email fields in the db
are empty. One issue with my webhost is that I cannot send by CDOSYS more
than 99 emails at a time, so I select all emails where the ID is less than
97, that is about 85 emails total. After the first group goes out the page
redirects to another page so the next group can go out.

Here is how I select the emails: rs.open "select MemberEmail from membership
where MemberEmail <> '""' AND ID <= 97",aqe,3,3

As a test I copied the member database, replaced all the member email
addresses with 3 different email addresses that I have and the form works
fine. I get a copy of the message for every member who I gave one of my
email addresses to. However, when I use the members real addresses I get the
'8004020f' error. I found a place on the web that said that error means,
among other things, an invalid email address. I have looked at the db and
there were a couple bad addresses. One person had .net instead of .com for
their ISP and one person was at abc@gmail. They had left off the .com part,
I fixed those but it still hangs.

It looks to me like the SMTP server is somehow validating the emails before
sending them off, and if the email is not valid it crashes instead of just
skipping over it. When I use my 3 good email addresses it works fine but not
with the member's addresses. Any ideas on how to fix this?

Re: Error 8004020f when using CDOSYS

am 15.07.2007 02:57:07 von Larry D

New discovery. I set up a page just to write out all the email addresses one
per line to see what I would get using this statement:

sqlstr = "select MemberEmail, ID from Membership where MemberEmail <> '""'
AND ID <= 115 order by ID"

I am getting some gaps in my lines. Apparently there are some non-empty
fields with just a space in them. CDOSYS treats that like a bad address and
posts the error message I get. using the <>'""' I avoid fields that are
truly empty but not ones where the member might put a space in then decides
against putting in his email address. How do I test for that?

Larry

"Larry D" wrote in message
news:esP8CpkxHHA.4276@TK2MSFTNGP05.phx.gbl...
>I have a client with a site that users can register at, we collect their
>emails, if they have one, in an Access db. I have a page that uses CDOSYS
>to send messages to those emails but I am getting "error '8004020f" when I
>do this. About 75% of the members have emails so some email fields in the
>db are empty. One issue with my webhost is that I cannot send by CDOSYS
>more than 99 emails at a time, so I select all emails where the ID is less
>than 97, that is about 85 emails total. After the first group goes out the
>page redirects to another page so the next group can go out.
>
> Here is how I select the emails: rs.open "select MemberEmail from
> membership where MemberEmail <> '""' AND ID <= 97",aqe,3,3
>
> As a test I copied the member database, replaced all the member email
> addresses with 3 different email addresses that I have and the form works
> fine. I get a copy of the message for every member who I gave one of my
> email addresses to. However, when I use the members real addresses I get
> the '8004020f' error. I found a place on the web that said that error
> means, among other things, an invalid email address. I have looked at the
> db and there were a couple bad addresses. One person had .net instead of
> .com for their ISP and one person was at abc@gmail. They had left off the
> .com part, I fixed those but it still hangs.
>
> It looks to me like the SMTP server is somehow validating the emails
> before sending them off, and if the email is not valid it crashes instead
> of just skipping over it. When I use my 3 good email addresses it works
> fine but not with the member's addresses. Any ideas on how to fix this?
>

Re: Error 8004020f when using CDOSYS

am 16.07.2007 01:24:32 von Larry D

I finally found a fix by doing it this way:

select MemberEmail AS email from membership where ((ID <= 115) AND
(MemberEmail <> '""') AND (len(MemberEmail) > 5))"

which fixed the problem of spaces in the email address field and no real
text,. I then do

objMail.To = email

instead of

objMail.To = trim(request.form("MemberEmail"))

Seems to work now.


"Larry D" wrote in message
news:%231BYRsnxHHA.3400@TK2MSFTNGP03.phx.gbl...
> New discovery. I set up a page just to write out all the email addresses
> one per line to see what I would get using this statement:
>
> sqlstr = "select MemberEmail, ID from Membership where MemberEmail <> '""'
> AND ID <= 115 order by ID"
>
> I am getting some gaps in my lines. Apparently there are some non-empty
> fields with just a space in them. CDOSYS treats that like a bad address
> and posts the error message I get. using the <>'""' I avoid fields that
> are truly empty but not ones where the member might put a space in then
> decides against putting in his email address. How do I test for that?
>
> Larry
>
> "Larry D" wrote in message
> news:esP8CpkxHHA.4276@TK2MSFTNGP05.phx.gbl...
>>I have a client with a site that users can register at, we collect their
>>emails, if they have one, in an Access db. I have a page that uses CDOSYS
>>to send messages to those emails but I am getting "error '8004020f" when I
>>do this. About 75% of the members have emails so some email fields in the
>>db are empty. One issue with my webhost is that I cannot send by CDOSYS
>>more than 99 emails at a time, so I select all emails where the ID is less
>>than 97, that is about 85 emails total. After the first group goes out the
>>page redirects to another page so the next group can go out.
>>
>> Here is how I select the emails: rs.open "select MemberEmail from
>> membership where MemberEmail <> '""' AND ID <= 97",aqe,3,3
>>
>> As a test I copied the member database, replaced all the member email
>> addresses with 3 different email addresses that I have and the form works
>> fine. I get a copy of the message for every member who I gave one of my
>> email addresses to. However, when I use the members real addresses I get
>> the '8004020f' error. I found a place on the web that said that error
>> means, among other things, an invalid email address. I have looked at the
>> db and there were a couple bad addresses. One person had .net instead of
>> .com for their ISP and one person was at abc@gmail. They had left off the
>> .com part, I fixed those but it still hangs.
>>
>> It looks to me like the SMTP server is somehow validating the emails
>> before sending them off, and if the email is not valid it crashes instead
>> of just skipping over it. When I use my 3 good email addresses it works
>> fine but not with the member's addresses. Any ideas on how to fix this?
>>
>
>