473,382 Members | 1,147 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

error '8004020f' ASP Programming help w/ SMTP

I'm having a problem with an ASP page I've made and was hoping someone
out there can help.

My page sends an email using CDO to a username pulled from a database
as follows:

With cdoMessage
Set .Configuration = cdoConfig
.From = "Admin <ad***@MyCompany.com>"
.To = rs("USERName") & "@MyCompany.com"
.Subject = "Notification #" & rs("subject_Num")
.TextBody = txtVar
.Send
End With

this works great so long as USERName isn't garbage. If there are bad
characters in it that IIS doesn't like, it get an error '8004020f' at
the .send line. I was wondering if there was an easy and / or
publicly available code snippet that could check the user name for
special chars. Ideally, it would email me if there was a problem with
the USERName rather than just strip the bad chars out and send it to
whatever is left.

Any help pointing me in the right direction would be greatly
appreciated.

Paco
Jul 19 '05 #1
5 3249
> this works great so long as USERName isn't garbage.

So don't allow usernames with garbage!?!??

Validate going on (keeping your data clean) or at least on the way out.

This will help with the whole address, which you should construct and
validate before even entering With cdoMessage...

http://www.aspfaq.com/2238

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
Jul 19 '05 #2
On 18 Feb 2004 14:17:04 -0800, st*****@iwon.com (Paco) wrote:
I'm having a problem with an ASP page I've made and was hoping someone
out there can help.

My page sends an email using CDO to a username pulled from a database
as follows:

With cdoMessage
Set .Configuration = cdoConfig
.From = "Admin <ad***@MyCompany.com>"
.To = rs("USERName") & "@MyCompany.com"
.Subject = "Notification #" & rs("subject_Num")
.TextBody = txtVar
.Send
End With

this works great so long as USERName isn't garbage. If there are bad
characters in it that IIS doesn't like, it get an error '8004020f' at
the .send line. I was wondering if there was an easy and / or
publicly available code snippet that could check the user name for
special chars. Ideally, it would email me if there was a problem with
the USERName rather than just strip the bad chars out and send it to
whatever is left.

Any help pointing me in the right direction would be greatly
appreciated.


This is normal error checking and validation. It can be done client
side or server side (or both) but client side, while easy and fast,
can be spoofed by a knowledgeable user. For code snippets, search on
"validate email address format" and toss in "asp" or "javascript" and
you'll find plenty. Good starting points:

http://www.aspin.com/home/tutorial/e...g=2&order=desc
http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=47

Jeff
Jul 19 '05 #3
Jeff - Thanks so much. I found on this page
http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=47 a great solution
that works perfectly. I don't understand it yet but I hope to.

regEx.Pattern ="^[\w-\.]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]{2,3}$"

Thanks again,
P
jc*************@naplesgov.com (Jeff Cochran) wrote in message
news:<40****************@msnews.microsoft.com>...
This is normal error checking and validation. It can be done client
side or server side (or both) but client side, while easy and fast,
can be spoofed by a knowledgeable user. For code snippets, search on
"validate email address format" and toss in "asp" or "javascript" and
you'll find plenty. Good starting points:

http://www.aspin.com/home/tutorial/e...g=2&order=desc
http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=47

Jeff

Jul 19 '05 #4

I am currently working on a Web site that is coming up with the sam
error. I can send to anyone within my ISP's domain (cox.net), but if
use a domain outside of the ISP's network for the recipient (gmail.com
etc.), this is the error I get. Oddly enough, I can send *from* an
domain I want. I have tried sending from my GMail account, as well a
from a couple of other domains I have, and they all work fine. Th
problem only appears when I send e-mail to someone who's e-mail addres
is not on Cox Communications' mail server. I've got all sorts o
validation and such in the code, but it just doesn't seem to want t
work. Any other suggestions for things to look at? I'd greatl
appreciate it. Thank you for your time.

G_Hosa_Pha

--
G_Hosa_Pha
-----------------------------------------------------------------------
G_Hosa_Phat's Profile: http://www.msusenet.com/member.php?userid=27
View this thread: http://www.msusenet.com/t-294348

Jul 22 '05 #5
On Tue, 29 Mar 2005 18:18:25 -0500, G_Hosa_Phat
<G_****************@no-mx.msusenet.com> wrote:

I am currently working on a Web site that is coming up with the same
error. I can send to anyone within my ISP's domain (cox.net), but if I
use a domain outside of the ISP's network for the recipient (gmail.com,
etc.), this is the error I get. Oddly enough, I can send *from* any
domain I want. I have tried sending from my GMail account, as well as
from a couple of other domains I have, and they all work fine. The
problem only appears when I send e-mail to someone who's e-mail address
is not on Cox Communications' mail server. I've got all sorts of
validation and such in the code, but it just doesn't seem to want to
work. Any other suggestions for things to look at? I'd greatly
appreciate it. Thank you for your time.


FAQ:

Why does CDO.Message give me 8004020F errors?
http://www.aspfaq.com/show.asp?id=2305

Jeff
Jul 22 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: alex | last post by:
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...
6
by: Owen | last post by:
Hi, can somebody help me please... I'm trying to set up a very simple asp page that sends me an email when it runs. This is just to try and get CDOSYS working so I can send out emails from my...
1
by: Luis andyza | last post by:
I use CDO.Message to send e-mail from an asp page (similar to the method at http://www.aspfaq.com/show.asp?id=2305). One of my testers entered an invalid e-mail address and got an 8004020F error....
2
by: dmalhotr2001 | last post by:
Hi, I'm using windows 2003 with asp. However I'm having problems sending email using the cdosys object. My code is below and I don't believe its the code but on the send command. <% dim...
2
by: Mario Michela | last post by:
i've been working for 4 days trying to accomplish something that should take 20 minutes.. I have an asp page that take user info, ie name, address phone, email. it sends a copy to email addres A...
1
by: Vijay | last post by:
Hi, I have a problem to send Mail in ASP. I am using CDO for sending mail. My Server configuration are : Windows Server 2003 Stadndard Edition with R2, Service Pack 2, Microsoft Management...
0
by: Larry D | last post by:
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...
2
by: candywang | last post by:
first , my english is bad~~~I'm sorry! I got some problem. Flds("http://schemas.microsoft.com/cdo/configuration/smtpserver") =real ip(remote machine)...
7
by: ayush patel | last post by:
Hi everyone, I am writing ASP code to send email using SMTP.I am getting error '8004020f' at .Send. this seems to be a common error. my SMTP server relays to anonymous email addresses.there is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.